blob: f3933ec7ecbb7d796caf178977c5718ce5ab6ca9 [file] [log] [blame] [view]
Karl Schultzb0b3cac2016-03-09 12:48:04 -07001## 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.
Karl Schultz2f21c0c2016-02-26 15:42:57 -070017
18### **How to Submit Fixes**
19
Karl Schultzb0b3cac2016-03-09 12:48:04 -070020* **Ensure that the bug was not already reported or fixed** by searching on GitHub under Issues
21 and Pull Requests.
Karl Schultz2f21c0c2016-02-26 15:42:57 -070022* 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.
Karl Schultzb0b3cac2016-03-09 12:48:04 -070026* 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.
Karl Schultz2f21c0c2016-02-26 15:42:57 -070029
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.
Karl Schultz2f21c0c2016-02-26 15:42:57 -070036 * A sample git workflow may look like:
37
38> # Make changes to the source.
39> $ git add .
Karl Schultzb0b3cac2016-03-09 12:48:04 -070040> $ clang-format -style=file -i < list of changed code files >
Karl Schultz2f21c0c2016-02-26 15:42:57 -070041> # Check to see if clang-format made any changes and if they are OK.
42> $ git add .
43> $ git commit
44
45#### **Testing**
Karl Schultzb0b3cac2016-03-09 12:48:04 -070046* 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.
Karl Schultz2f21c0c2016-02-26 15:42:57 -070048 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.
Karl Schultzb0b3cac2016-03-09 12:48:04 -070066* Run tests that explicitly exercise your changes.
Karl Schultz2f21c0c2016-02-26 15:42:57 -070067* Feel free to subject your code changes to other tests as well!
68
Karl Schultz43f4e6d2016-04-28 13:55:42 -060069#### **Special Considerations for Validation Layers**
70If you are submitting a change that adds a new validation check, you should also construct a "negative" test function.
71The negative test function purposely violates the validation rule that the new validation check is looking for.
72The test should cause your new validation check to identify the violation and issue a validation error report.
73And finally, the test should check that the validation error report is generated and consider the test as "passing"
74if the report is received. Otherwise, the test should indicate "failure".
75This new test should be added to the validation layer test program in the `tests` directory and contributed
76at the same time as the new validation check itself.
77There are many existing validation tests in this directory that can be used as a starting point.
78
79
Karl Schultz2f21c0c2016-02-26 15:42:57 -070080### **Contributor License Agreement (CLA)**
81
Karl Schultzb0b3cac2016-03-09 12:48:04 -070082#### **Khronos Repository (Vulkan-LoaderAndValidationLayers)**
83
Karl Schultz2f21c0c2016-02-26 15:42:57 -070084The Khronos Group is still finalizing the CLA process and documentation,
85so the details about using or requiring a CLA are not available yet.
86In the meantime, we suggest that you not submit any contributions unless you are comfortable doing so without a CLA.
87
Karl Schultzb0b3cac2016-03-09 12:48:04 -070088#### **LunarG Repositories**
89
90You'll be prompted with a "click-through" CLA as part of submitting your pull request in GitHub.
91
92### **License and Copyrights**
93
94All contributions made to the Vulkan-LoaderAndValidationLayers repository are Khronos branded and as such,
Jon Ashburn43b53e82016-04-19 11:30:31 -060095any new files need to have the Khronos license (Apache 2.0 style) and copyright included.
Karl Schultzb0b3cac2016-03-09 12:48:04 -070096Please see an existing file in this repository for an example.
97
Jon Ashburn43b53e82016-04-19 11:30:31 -060098All contributions made to the LunarG repositories are to be made under the Apache 2.0 license
Karl Schultzb0b3cac2016-03-09 12:48:04 -070099and any new files need to include this license and any applicable copyrights.
100
101You can include your individual copyright after any existing copyrights.