blob: 9afc7938989a5b85e48a09a9aea9d6e4efb64a53 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
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
|
## Configure CMake and Build
To configure cmake, run `cmake --preset default --fresh`.
To build, run `cmake --workflow --preset debug` or `cmake --workflow --preset release`.
Build instructions can be found in docs/building.md
## Formatting
Your PR needs to be formatted according to our coding style.
Run `./extras/formatting.sh` script to format your changes before submitting them.
## Labeling your PR
All PRs needs to be labeled as either "pr: non-breaking" or "pr: breaking".
Add the "pr: breaking" label to your PR if you are introducing public API changes that breaks ABI compabibility,
or you are introducing changes to the Slang language that will cause the compiler to error out on existing Slang code.
It is rare for a PR to be a breaking change.
## Testing
Your PR should include a regression test for the bug you are fixing.
Normally, these tests present as a `.slang` file under `tests/` directory.
You will need to run your test with `slang-test tests/path/to/your-new-test.slang`.
You will need to build the `slang-test` target first.
Note that your execution environment does not have a GPU, so you can't run any tests that requires a GPU locally, for example,
you won't be able to run a shader test using D3D12, Vulkan, Metal or WGSL.
If the changes you are making is not specific to a particular GPU target, you can craft your test case to run on the CPU
by writing the following as the first line of your test shader:
```
//TEST:COMPARE_COMPUTE(filecheck-buffer=CHECK):-output-using-type -cpu
```
See `tests/language-feature/lambda/lambda-0.slang` for a full example.
Or you can craft your test to run with `slangi` (byte-code interpreter), such as:
```
//TEST:INTERPRET(filecheck=CHECK):
void main()
{
//CHECK: hello!
printf("hello!");
}
```
If you are working on a GPU specific feature, don't try to run the test locally, just leave your PR to the CI for verification.
|