Skip to content
This repository has been archived by the owner on Jul 19, 2018. It is now read-only.
Mark Lobodzinski edited this page Mar 1, 2018 · 3 revisions

Welcome to the Vulkan-LoaderAndValidationLayers wiki.

Please take special note of the Contributing.md file.

Instructions for Implementing Vulkan Header Updates:

Note: The complete set of header update changes should be squashed into a single commit

Copy new Vulkan-Docs file changes into Vulkan-LoaderAndValidationLayers

Check out the Khronos Vulkan-Docs repository or switch to the 1.0 branch and update

  • Copy vulkan.h from Vulkan-Docs to Vulkan-LoaderAndValidationLayers\include\vulkan
  • Copy vk_platform.h from Vulkan-Docs to Vulkan-LoaderAndValidationLayers\include\vulkan
  • Copy vk.xml from Vulkan-Docs to Vulkan-LoaderAndValidationLayers\scripts
  • Copy generator.py from Vulkan-Docs to Vulkan-LoaderAndValidationLayers\scripts
  • Copy cgenerator.py from Vulkan-Docs to Vulkan-LoaderAndValidationLayers\scripts
  • Copy reg.py from Vulkan-Docs to Vulkan-LoaderAndValidationLayers\scripts
  • Pull the appropriate version of the Vulkan-Docs repository, build validusage.json, and copy it to Vulkan-LoaderAndValidationLayers\scripts
  • Merge any changes to genvk.py into lvl_genvk.py in Vulkan-LoaderAndValidationLayers\scripts.

Update json file version numbers

In the Vulkan-LoaderAndValidationLayers\layers and Vulkan-LoaderAndValidationLayers\tests\layers directories, modify the Vulkan version numbers contained in the *.json files to match the new version number

Update Valid Usage Identifiers

Update the VUID database and header file (Vulkan-LoaderAndValidationLayers\layers\vk_validation_error_*.*):

  • In the Vulkan-LoaderAndValidationLayers/scripts directory, run ‘python spec.py -update’
  • If running from Windows, be sure to reset to unix line endings
  • If no errors, check in diffs. Note that this will probably add a bunch of new VUs.
  • Run vkvalidatelayerdoc.[sh|ps1] and it’ll probably fail, outputting a list of VUs that appear in the source code but not in the database. Update these VUs in the database by changing the <check_implemented> field from 'N' to 'Y'.

Build and update Vulkan.hpp:

Using the instructions below, update include/vulkan/vulkan.hpp

Make Validation changes required by Vulkan header changes

This may include updates for new APIs, new extensions, or changes to existing APIs that cause incorrect validation errors or false positives.

Make Loader changes required by Vulkan header changes

The loader may need modifications for new Instance or PhysicalDevice Extensions

Build and test the repo

Resolve build issues, and run all tests with combined header update changes to verify correct operation. Ideally, this should include a CTS test pass including tests for new APIs/Extensions

Create a PR and commit

  • Create a PR to notify the appropriate folks
  • After a successful run through GitHub's CI, push the commit

Updating the Vulkan.hpp file

The vulkan.hpp file is generated from the Vulkan-Hpp repo, located here. Currently, an up-to-date copy of vulkan.hpp is kept in Vulkan-LoaderAndValidationLayers\include\vulkan alongside vulkan.h. When the header is updated, vulkan.hpp must be regenerated in order for the Vulkan-LoaderAndValidationLayers repo to build correctly.

Generating a new vulkan.hpp

  • Clone the project from: https://github.com/KhronosGroup/Vulkan-Hpp.git
  • Update submodules by running git submodule update --init --recursive
  • Build the project using cmake and the native build system, i.e., cmake -H. -Bbuild and then make (Linux) or 'mkdir build; cd build; cmake -G "Visual Studio 15 Win64" .. for Windows, followed by opening the solution and building in MSVC.
  • Run the resultant executable VulkanHppGenerator.exewith one argument, which is the path to the updated copy of vk.xml
  • The output should be generated in Vulkan-Hpp/vulkan/vulkan.hpp. If there are build errors or run-time issues these will need to be resolved before continuing.
  • If necessary, reset vulkan.hpp file to use Unix-style line endings before committing