1 ## How to Contribute to Vulkan Source Repositories
3 ### **The Repositories**
5 The Vulkan source code is distributed across several GitHub repositories.
6 The repositories sponsored by Khronos and LunarG are described here.
7 In general, the canonical Vulkan Loader and Validation Layers sources are in the Khronos repository,
8 while the LunarG repositories host sources for additional tools and sample programs.
10 * [Khronos Vulkan-LoaderAndValidationLayers](https://github.com/KhronosGroup/Vulkan-LoaderAndValidationLayers)
11 * [LunarG VulkanTools](https://github.com/LunarG/VulkanTools)
12 * [LunarG VulkanSamples](https://github.com/LunarG/VulkanSamples)
14 As a convenience, the contents of the Vulkan-LoaderAndValidationLayers repository are downstreamed into the VulkanTools and VulkanSamples repositories via a branch named `trunk`.
15 This makes the VulkanTools and VulkanSamples easier to work with and avoids compatibility issues
16 that might arise with Vulkan-LoaderAndValidationLayers components if they were obtained from a separate repository.
18 ### **How to Submit Fixes**
20 * **Ensure that the bug was not already reported or fixed** by searching on GitHub under Issues
22 * Use the existing GitHub forking and pull request process.
23 This will involve [forking the repository](https://help.github.com/articles/fork-a-repo/),
24 creating a branch with your commits, and then [submitting a pull request](https://help.github.com/articles/using-pull-requests/).
25 * Please base your fixes on the master branch. SDK branches are generally not updated except for critical fixes needed to repair an SDK release.
26 * Please include the GitHub Issue number near the beginning of the commit text if applicable.
27 * Example: "GitHub 123: Fix missing init"
28 * 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.
31 #### **Coding Conventions and Formatting**
32 * Try to follow any existing style in the file. "When in Rome..."
33 * Run clang-format on your changes to maintain formatting.
34 * There are `.clang-format files` throughout the repository to define clang-format settings
35 which are found and used automatically by clang-format.
36 * A sample git workflow may look like:
38 > # Make changes to the source.
40 > $ git clang-format --style=file
41 > # Check to see if clang-format made any changes and if they are OK.
46 * Run the existing tests in the repository before and after your changes to check for any regressions.
47 There are some tests that appear in all repositories.
48 These tests can be found in the following folders inside of your target build directory:
49 (These instructions are for Linux)
50 * In the `demos` directory, run:
60 * In the `tests` directory, run:
64 * Note that some tests may fail with known issues or driver-specific problems.
65 The idea here is that your changes shouldn't change the test results, unless that was the intent of your changes.
66 * Run tests that explicitly exercise your changes.
67 * Feel free to subject your code changes to other tests as well!
69 #### **Special Considerations for Validation Layers**
70 If you are submitting a change that adds a new validation check, you should also construct a "negative" test function.
71 The negative test function purposely violates the validation rule that the new validation check is looking for.
72 The test should cause your new validation check to identify the violation and issue a validation error report.
73 And finally, the test should check that the validation error report is generated and consider the test as "passing"
74 if the report is received. Otherwise, the test should indicate "failure".
75 This new test should be added to the validation layer test program in the `tests` directory and contributed
76 at the same time as the new validation check itself.
77 There are many existing validation tests in this directory that can be used as a starting point.
80 ### **Contributor License Agreement (CLA)**
82 #### **Khronos Repository (Vulkan-LoaderAndValidationLayers)**
84 The Khronos Group is still finalizing the CLA process and documentation,
85 so the details about using or requiring a CLA are not available yet.
86 In the meantime, we suggest that you not submit any contributions unless you are comfortable doing so without a CLA.
88 #### **LunarG Repositories**
90 You'll be prompted with a "click-through" CLA as part of submitting your pull request in GitHub.
92 ### **License and Copyrights**
94 All contributions made to the Vulkan-LoaderAndValidationLayers repository are Khronos branded and as such,
95 any new files need to have the Khronos license (Apache 2.0 style) and copyright included.
96 Please see an existing file in this repository for an example.
98 All contributions made to the LunarG repositories are to be made under the Apache 2.0 license
99 and any new files need to include this license and any applicable copyrights.
101 You can include your individual copyright after any existing copyrights.