Skip to content

Commit 469d6c3

Browse files
authored
Merge pull request #1 from natevm/master
integrating changes from upstream...
2 parents b5e3ca5 + 7b220e3 commit 469d6c3

File tree

1,707 files changed

+218372
-163659
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,707 files changed

+218372
-163659
lines changed

.clang-format

+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
BasedOnStyle: LLVM
2+
3+
# Whitespace
4+
MaxEmptyLinesToKeep: 2
5+
IndentWidth: 4
6+
ColumnLimit: 100
7+
8+
# Preprocessor
9+
AlignEscapedNewlines: Left
10+
IncludeBlocks: Regroup
11+
12+
# Functions
13+
AllowAllArgumentsOnNextLine: false
14+
BinPackArguments: false
15+
BinPackParameters: false
16+
AllowAllParametersOfDeclarationOnNextLine: false
17+
PenaltyReturnTypeOnItsOwnLine: 9999999
18+
PenaltyBreakBeforeFirstCallParameter: 6
19+
AllowShortFunctionsOnASingleLine: Inline
20+
21+
# Brackets and braces
22+
AlignAfterOpenBracket: AlwaysBreak
23+
BreakBeforeBraces: Allman
24+
25+
# Pointers
26+
PointerAlignment: Left
27+
28+
# Classes
29+
PackConstructorInitializers: NextLineOnly
30+
BreakConstructorInitializers: BeforeComma
31+
AccessModifierOffset: -4
32+
33+
# Switch statements
34+
IndentCaseBlocks: true
35+
36+
# Templates
37+
SpaceAfterTemplateKeyword: false
38+
AlwaysBreakTemplateDeclarations: true
39+
40+
# Misc
41+
SortUsingDeclarations: false

.github/CODEOWNERS

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
* @shader-slang/dev
2+
/docs/proposals @tangent-vector @csyonghe @expipiplus1

.github/actions/common-setup/action.yml

+24-18
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,13 @@ inputs:
1616
runs:
1717
using: composite
1818
steps:
19+
- name: Add bash to PATH
20+
shell: pwsh
21+
if: ${{inputs.os == 'windows'}}
22+
run: |
23+
Add-Content -Path $env:GITHUB_PATH -Value "C:\\Program Files\\Git\\bin"
24+
Add-Content -Path $env:GITHUB_PATH -Value "C:\\Program Files\\Git\\usr\\bin"
25+
1926
- name: Set up MSVC dev tools on Windows
2027
uses: ilammy/msvc-dev-cmd@v1
2128
with:
@@ -59,14 +66,20 @@ runs:
5966
6067
# Some useful variables
6168
config=${{inputs.config}}
62-
Config=$(echo "${{inputs.config}}" | sed 's/debug/Debug/;s/release/Release/')
63-
bin_dir=$(pwd)/build/$Config/bin
64-
lib_dir=$(pwd)/build/$Config/lib
69+
cmake_config=$(echo "${{inputs.config}}" | sed '
70+
s/^debug$/Debug/
71+
s/^release$/Release/
72+
s/^releaseWithDebugInfo$/RelWithDebInfo/
73+
s/^minSizeRelease$/MinSizeRel/
74+
')
75+
bin_dir=$(pwd)/build/$cmake_config/bin
76+
lib_dir=$(pwd)/build/$cmake_config/lib
6577
echo "config=$config" >> "$GITHUB_ENV"
78+
echo "cmake_config=$cmake_config" >> "$GITHUB_ENV"
6679
echo "bin_dir=$bin_dir" >> "$GITHUB_ENV"
6780
echo "lib_dir=$lib_dir" >> "$GITHUB_ENV"
6881
69-
# Try to restore a LLVM install, and build it otherwise
82+
# Try to restore an LLVM install, and build it otherwise
7083
- uses: actions/cache/restore@v4
7184
id: cache-llvm
7285
if: inputs.build-llvm == 'true'
@@ -77,25 +90,17 @@ runs:
7790
- name: Build LLVM
7891
if: inputs.build-llvm == 'true' && steps.cache-llvm.outputs.cache-hit != 'true'
7992
shell: bash
80-
run: ./external/build-llvm.sh --install-prefix "${{ github.workspace }}/build/llvm-project-install"
93+
run: |
94+
./external/build-llvm.sh \
95+
--install-prefix "${{github.workspace}}/build/llvm-project-install" \
96+
--repo "https://${{github.token}}@github.com/llvm/llvm-project"
8197
- uses: actions/cache/save@v4
8298
if: inputs.build-llvm == 'true' && steps.cache-llvm.outputs.cache-hit != 'true'
8399
with:
84100
path: ${{ github.workspace }}/build/llvm-project-install
85101
key: ${{ steps.cache-llvm.outputs.cache-primary-key }}
86102

87-
# Run this after building llvm, it's pointless to fill the caches with
88-
# infrequent llvm build products
89-
- name: Set up sccache
90-
uses: hendrikmuhs/ccache-action@v1.2
91-
with:
92-
key: ${{inputs.os}}-${{inputs.compiler}}-${{inputs.platform}}-${{inputs.config}}
93-
variant: sccache
94-
# Opportunistically use sccache, it's not available for example on self
95-
# hosted runners or ARM
96-
continue-on-error: true
97-
98-
- name: Set environment variable for CMake
103+
- name: Set environment variable for CMake and sccache
99104
shell: bash
100105
run: |
101106
if [ "${{inputs.build-llvm}}" == "true" ]; then
@@ -108,9 +113,10 @@ runs:
108113
echo "CMAKE_CXX_COMPILER_LAUNCHER=sccache" >> "$GITHUB_ENV"
109114
echo "CMAKE_C_COMPILER_LAUNCHER=sccache" >> "$GITHUB_ENV"
110115
fi
116+
echo SCCACHE_IGNORE_SERVER_IO_ERROR=1 >> "$GITHUB_ENV"
111117
112118
# Install swiftshader
113-
- uses: robinraju/release-downloader@v1.8
119+
- uses: robinraju/release-downloader@v1.11
114120
continue-on-error: true
115121
with:
116122
latest: true
+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Formatting tools setup
2+
3+
description: Performs setup common to the code formatting actions
4+
5+
runs:
6+
using: composite
7+
steps:
8+
- name: install gersemi
9+
shell: bash
10+
run: |
11+
pip3 install gersemi colorama
12+
13+
- name: install clang-format
14+
shell: bash
15+
run: |
16+
tmpdir=$(mktemp -d)
17+
curl -L -H "Authorization: token ${{github.token}}" \
18+
-o "$tmpdir/clang-format" \
19+
https://github.com/shader-slang/slang-binaries/raw/306d22efc0f5f72c7230b0b6b7c99f03c46995bd/clang-format/x86_64-linux/bin/clang-format
20+
chmod +x "$tmpdir/clang-format"
21+
echo "$tmpdir" >> $GITHUB_PATH
22+
23+
- name: install prettier
24+
shell: bash
25+
run: |
26+
npm install -g prettier@3.3.3
27+
echo "$(npm bin -g)" >> $GITHUB_PATH
28+
29+
- name: install shfmt
30+
shell: bash
31+
run: |
32+
tmpdir=$(mktemp -d)
33+
curl -L -H "Authorization: token ${{github.token}}" \
34+
-o "$tmpdir/shfmt" \
35+
https://github.com/mvdan/sh/releases/download/v3.10.0/shfmt_v3.10.0_linux_amd64
36+
chmod +x "$tmpdir/shfmt"
37+
echo "$tmpdir" >> $GITHUB_PATH

.github/workflows/benchmark.yml

+16-14
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,19 @@ on:
44
push:
55
branches: [master]
66
paths-ignore:
7-
- 'docs/**'
8-
- 'LICENCE'
9-
- 'CONTRIBUTION.md'
10-
- 'README.md'
7+
- "docs/**"
8+
- "LICENSES/**"
9+
- "LICENSE"
10+
- "CONTRIBUTING.md"
11+
- "README.md"
1112
pull_request:
1213
branches: [master]
1314
paths-ignore:
14-
- 'docs/**'
15-
- 'LICENCE'
16-
- 'CONTRIBUTION.md'
17-
- 'README.md'
15+
- "docs/**"
16+
- "LICENSES/**"
17+
- "LICENSE"
18+
- "CONTRIBUTING.md"
19+
- "README.md"
1820
concurrency:
1921
group: ${{ github.workflow }}-${{ github.ref }}
2022
cancel-in-progress: true
@@ -23,10 +25,10 @@ jobs:
2325
build:
2426
runs-on: [Windows, self-hosted]
2527
steps:
26-
- uses: actions/checkout@v3
28+
- uses: actions/checkout@v4
2729
with:
28-
submodules: 'recursive'
29-
fetch-depth: '0'
30+
submodules: "recursive"
31+
fetch-depth: "0"
3032
- name: Common setup
3133
uses: ./.github/actions/common-setup
3234
with:
@@ -39,10 +41,10 @@ jobs:
3941
run: |
4042
cmake --preset default --fresh -DSLANG_SLANG_LLVM_FLAVOR=USE_SYSTEM_LLVM -DCMAKE_COMPILE_WARNING_AS_ERROR=false
4143
cmake --workflow --preset release
42-
- uses: actions/checkout@v3
44+
- uses: actions/checkout@v4
4345
with:
44-
repository: 'shader-slang/MDL-SDK'
45-
path: 'external/MDL-SDK'
46+
repository: "shader-slang/MDL-SDK"
47+
path: "external/MDL-SDK"
4648
- name: Run benchmark
4749
run: |
4850
cd tools/benchmark
+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
name: Check Formatting (comment /format to auto-fix)
2+
3+
on:
4+
push:
5+
branches: [master]
6+
pull_request:
7+
branches: [master]
8+
jobs:
9+
check-formatting:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v4
13+
- uses: ./.github/actions/format-setup
14+
- run: ./extras/formatting.sh --check-only

.github/workflows/check-toc.yml

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
name: Check Table of Contents (comment /regenerate-toc to auto-fix)
2+
3+
on:
4+
push:
5+
branches: [master]
6+
pull_request:
7+
branches: [master]
8+
jobs:
9+
check-formatting:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v4
13+
- run: ./docs/build_toc.sh --check-only

0 commit comments

Comments
 (0)