Skip to content

Commit e12cd51

Browse files
Remove LLVM 20 limitation
- clang-format ignore on CoroutineScheduler.h and VulkanDevice.h for operator bool() - update ubuntu CI workflow to use version 21 as it tends to be behind in its inbuild version
1 parent 2173db0 commit e12cd51

10 files changed

Lines changed: 29 additions & 21 deletions

File tree

.github/workflows/Engine-CI.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
on:
22
push:
3-
branches: [ master, develop, arena-integration ]
3+
branches: [ master, develop, arena-integration, testllvm22 ]
44
pull_request:
55
branches: [ master, develop, arena-integration ]
66

.github/workflows/job-clangformat.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ jobs:
1111
name: clang-format
1212
runs-on: windows-2022
1313
steps:
14+
- name: Update llvm
15+
run: choco upgrade llvm
16+
1417
- name: Checkout repository
1518
uses: actions/checkout@v4
1619

.github/workflows/job-cmakebuild-linux.yml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,17 @@ jobs:
2525
- name: Register the Microsoft repository GPG keys
2626
run: sudo dpkg -i packages-microsoft-prod.deb
2727

28-
- name: Install LLVM-20
28+
- name: Install LLVM-21
2929
run: |
3030
wget https://apt.llvm.org/llvm.sh
3131
chmod +x llvm.sh
32-
sudo ./llvm.sh 20
32+
sudo ./llvm.sh 21
3333
34-
- name: Update the list of packages after we added packages.microsoft.com
34+
- name: Update the list of packages
3535
run: sudo apt-get update
36-
- name: Install development library
37-
run: sudo apt-get install libasound2-dev libgl1-mesa-dev libpulse-dev libdbus-1-dev libx11-dev libxcursor-dev libxext-dev libxi-dev libxinerama-dev libxrandr-dev libxss-dev libxt-dev libxxf86vm-dev cmake apt-transport-https software-properties-common gcc g++ powershell clang-format-20 libwayland-dev libxkbcommon-dev dotnet-sdk-8.0
36+
37+
- name: Install Dependencies
38+
run: sudo apt-get install libasound2-dev libgl1-mesa-dev libpulse-dev libdbus-1-dev libx11-dev libxcursor-dev libxext-dev libxi-dev libxinerama-dev libxrandr-dev libxss-dev libxt-dev libxxf86vm-dev cmake apt-transport-https software-properties-common gcc g++ powershell clang-format-21 glslang-tools libwayland-dev libxkbcommon-dev
3839

3940
- name: CMake Build
4041
run: .\Scripts\BuildEngine.ps1 -Configurations ${{inputs.configuration}}

.github/workflows/job-cmakebuild-macOS.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@ jobs:
2626
- name: Install NuGet CLI
2727
run: brew install nuget
2828

29+
- name: Update LLVM
30+
run: brew install llvm
31+
2932
- name: CMake Build
3033
run: .\Scripts\BuildEngine.ps1 -Configurations ${{inputs.configuration}} -Architecture ${{inputs.architecture}} -RunClangFormat 0
3134
shell: pwsh

.github/workflows/job-cmakebuild-windows.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ jobs:
2323
- name: Checkout repository
2424
uses: actions/checkout@v4
2525

26+
- name: Update-LLVM
27+
run: choco upgrade llvm
28+
2629
- name: CMake Build
2730
run: .\Scripts\BuildEngine.ps1 -Configurations ${{inputs.configuration}} -RunClangFormat 0
2831
shell: pwsh

Scripts/Shared.ps1

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,6 @@ function Find-GlslangValidator () {
189189
function Find-ClangFormat () {
190190
$repoConfiguration = Get-RepositoryConfiguration
191191
$LLVMMinimumVersion = $repoConfiguration.Requirements.LLVM.Version
192-
$LLVMMaximumVersion = $repoConfiguration.Requirements.LLVM.MaximumVersion
193192

194193
$candidates = @(
195194
if ($IsMacOS) {
@@ -201,6 +200,8 @@ function Find-ClangFormat () {
201200
}
202201
if ($IsLinux) {
203202
'/usr/bin/clang-format'
203+
'/usr/bin/clang-format-22'
204+
'/usr/bin/clang-format-21'
204205
'/usr/bin/clang-format-20'
205206
}
206207
'clang-format'
@@ -209,16 +210,11 @@ function Find-ClangFormat () {
209210
foreach ($candidate in $candidates) {
210211
$clangFormatCommand = Get-Command $candidate -ErrorAction SilentlyContinue
211212
if ($clangFormatCommand) {
212-
if ((& $clangFormatCommand --version | Out-String) -match "clang-format version ([\d\.]*)") {
213-
[Version] $clangFormatVersion = $Matches[1]
214-
if ((CompareVersion $clangFormatVersion $LLVMMinimumVersion) -and (CompareVersion $LLVMMaximumVersion $clangFormatVersion)) {
215213
return $clangFormatCommand.Source
216-
}
217-
}
218214
}
219215
}
220216

221-
throw "Failed to find clang-format min $LLVMMinimumVersion max $LLVMMaximumVersion. Tried: " + ($candidates -join ', ')
217+
throw "Failed to find clang-format min $LLVMMinimumVersion. Tried: " + ($candidates -join ', ')
222218
}
223219

224220
function Setup-ShaderCCompilerTool () {

ZEngine/ZEngine/Core/CoroutineScheduler.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,12 @@ namespace ZEngine::Core
1414

1515
ReadyCallback Ready = nullptr;
1616
ExecuteCallback Action = nullptr;
17-
17+
// clang-format off
1818
operator bool() noexcept
1919
{
2020
return (Ready && Action);
2121
}
22+
// clang-format on
2223
};
2324

2425
struct CoroutineScheduler

ZEngine/ZEngine/Hardwares/VulkanDevice.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,11 +76,12 @@ namespace ZEngine::Hardwares
7676
BufferType Type = BufferType::UNKNOWN;
7777
VkBuffer Handle = VK_NULL_HANDLE;
7878
VmaAllocation Allocation = nullptr;
79-
79+
// clang-format off
8080
operator bool() const
8181
{
8282
return (Handle != VK_NULL_HANDLE);
8383
}
84+
// clang-format on
8485
};
8586

8687
struct BufferImage
@@ -90,11 +91,12 @@ namespace ZEngine::Hardwares
9091
VkImageView ViewHandle{VK_NULL_HANDLE};
9192
VkSampler Sampler{VK_NULL_HANDLE};
9293
VmaAllocation Allocation{nullptr};
93-
94+
// clang-format off
9495
operator bool() const
9596
{
9697
return (Handle != VK_NULL_HANDLE);
9798
}
99+
// clang-format on
98100
};
99101

100102
struct IGraphicBuffer

ZEngine/ZEngine/Rendering/Renderers/RendererPasses.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ namespace ZEngine::Rendering::Renderers
5252
.EnablePipelineDepthTest(true)
5353
.UseShader("initial")
5454
.Detach();
55-
*output_pass = device->CreateRenderPass(pass_spec);
55+
*output_pass = device->CreateRenderPass(pass_spec);
5656
(*output_pass)->Bake();
5757
}
5858
}
@@ -91,7 +91,7 @@ namespace ZEngine::Rendering::Renderers
9191
.UseShader("depth_prepass_scene")
9292
.Detach();
9393

94-
*output_pass = device->CreateRenderPass(pass_spec);
94+
*output_pass = device->CreateRenderPass(pass_spec);
9595
(*output_pass)->Bake();
9696
}
9797

@@ -167,7 +167,7 @@ namespace ZEngine::Rendering::Renderers
167167
.UseShader("skybox")
168168
.Detach();
169169

170-
*output_pass = device->CreateRenderPass(pass_spec);
170+
*output_pass = device->CreateRenderPass(pass_spec);
171171
(*output_pass)->Bake();
172172
}
173173

@@ -255,7 +255,7 @@ namespace ZEngine::Rendering::Renderers
255255
.EnablePipelineDepthTest(true)
256256
.UseShader("infinite_grid")
257257
.Detach();
258-
*output_pass = device->CreateRenderPass(pass_spec);
258+
*output_pass = device->CreateRenderPass(pass_spec);
259259
(*output_pass)->Bake();
260260
}
261261

repoConfiguration.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
},
2525
"LLVM": {
2626
"Version": "20.1.7",
27-
"MaximumVersion": "20.2.0"
2827
}
2928
}
3029
}

0 commit comments

Comments
 (0)