1## How to Contribute to Vulkan Source Repositories
2
3### **The Repositories**
4
5The Vulkan source code is distributed across several GitHub repositories.
6The repositories sponsored by Khronos and LunarG are described here.
7In general, the canonical Vulkan Loader and Validation Layers sources are in the Khronos repository,
8while the LunarG repositories host sources for additional tools and sample programs.
9
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)
13
14As a convenience, the contents of the Vulkan-LoaderAndValidationLayers repository are downstreamed into the VulkanTools and VulkanSamples repositories via a branch named `trunk`.
15This makes the VulkanTools and VulkanSamples easier to work with and avoids compatibility issues
16that might arise with Vulkan-LoaderAndValidationLayers components if they were obtained from a separate repository.
17
18### **How to Submit Fixes**
19
20* **Ensure that the bug was not already reported or fixed** by searching on GitHub under Issues
21  and Pull Requests.
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.
29
30
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:
37
38>        # Make changes to the source.
39>        $ git add .
40>        $ clang-format -style=file -i < list of changed code files >
41>        # Check to see if clang-format made any changes and if they are OK.
42>        $ git add .
43>        $ git commit
44
45#### **Testing**
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:
51
52>        cube
53>        cube --validate
54>        tri
55>        tri --validate
56>        smoke
57>        smoke --validate
58>        vulkaninfo
59
60* In the `tests` directory, run:
61
62>        run_all_tests.sh
63
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!
68
69### **Contributor License Agreement (CLA)**
70
71#### **Khronos Repository (Vulkan-LoaderAndValidationLayers)**
72
73The Khronos Group is still finalizing the CLA process and documentation,
74so the details about using or requiring a CLA are not available yet.
75In the meantime, we suggest that you not submit any contributions unless you are comfortable doing so without a CLA.
76
77#### **LunarG Repositories**
78
79You'll be prompted with a "click-through" CLA as part of submitting your pull request in GitHub.
80
81### **License and Copyrights**
82
83All contributions made to the Vulkan-LoaderAndValidationLayers repository are Khronos branded and as such,
84any new files need to have the Khronos license (MIT style) and copyright included.
85Please see an existing file in this repository for an example.
86
87All contributions made to the LunarG repositories are to be made under the MIT license
88and any new files need to include this license and any applicable copyrights.
89
90You can include your individual copyright after any existing copyrights.
91