浏览代码

Fix the build

Panagiotis Christopoulos Charitos 6 月之前
父节点
当前提交
d1b72ecf4a

+ 6 - 6
.github/workflows/Linux.yml

@@ -13,7 +13,7 @@ jobs:
 
 
     steps:
     steps:
     - name: Install dependencies
     - name: Install dependencies
-      run: sudo apt install libx11-dev libx11-xcb-dev clang gcc
+      run: sudo apt install libsdl2-dev
 
 
     - name: Clone
     - name: Clone
       uses: actions/checkout@v3
       uses: actions/checkout@v3
@@ -30,7 +30,7 @@ jobs:
 
 
     steps:
     steps:
     - name: Install dependencies
     - name: Install dependencies
-      run: sudo apt install libx11-dev libx11-xcb-dev clang gcc
+      run: sudo apt install libsdl2-dev
 
 
     - name: Clone
     - name: Clone
       uses: actions/checkout@v3
       uses: actions/checkout@v3
@@ -47,7 +47,7 @@ jobs:
 
 
     steps:
     steps:
     - name: Install dependencies
     - name: Install dependencies
-      run: sudo apt install libx11-dev libx11-xcb-dev clang gcc
+      run: sudo apt install libsdl2-dev
 
 
     - name: Clone
     - name: Clone
       uses: actions/checkout@v3
       uses: actions/checkout@v3
@@ -64,7 +64,7 @@ jobs:
 
 
     steps:
     steps:
     - name: Install dependencies
     - name: Install dependencies
-      run: sudo apt install libx11-dev libx11-xcb-dev clang gcc
+      run: sudo apt install libsdl2-dev
 
 
     - name: Clone
     - name: Clone
       uses: actions/checkout@v3
       uses: actions/checkout@v3
@@ -81,7 +81,7 @@ jobs:
 
 
     steps:
     steps:
     - name: Install dependencies
     - name: Install dependencies
-      run: sudo apt install libx11-dev libx11-xcb-dev clang gcc
+      run: sudo apt install libsdl2-dev
 
 
     - name: Clone
     - name: Clone
       uses: actions/checkout@v3
       uses: actions/checkout@v3
@@ -98,7 +98,7 @@ jobs:
 
 
     steps:
     steps:
     - name: Install dependencies
     - name: Install dependencies
-      run: sudo apt install libx11-dev libx11-xcb-dev clang gcc
+      run: sudo apt install libsdl2-dev
 
 
     - name: Clone
     - name: Clone
       uses: actions/checkout@v3
       uses: actions/checkout@v3

+ 5 - 5
.github/workflows/Windows.yml

@@ -9,7 +9,7 @@ on:
 jobs:
 jobs:
   Debug_x64_VK:
   Debug_x64_VK:
     name: "Debug_x64_VK"
     name: "Debug_x64_VK"
-    runs-on: windows-latest
+    runs-on: windows-2025
 
 
     steps:
     steps:
     - name: Clone
     - name: Clone
@@ -23,7 +23,7 @@ jobs:
 
 
   Debug_x64_D3D:
   Debug_x64_D3D:
     name: "Debug_x64_D3D"
     name: "Debug_x64_D3D"
-    runs-on: windows-latest
+    runs-on: windows-2025
 
 
     steps:
     steps:
     - name: Clone
     - name: Clone
@@ -65,7 +65,7 @@ jobs:
 
 
   Release_x64_VK:
   Release_x64_VK:
     name: "Release_x64_VK"
     name: "Release_x64_VK"
-    runs-on: windows-latest
+    runs-on: windows-2025
 
 
     steps:
     steps:
     - name: Clone
     - name: Clone
@@ -79,7 +79,7 @@ jobs:
 
 
   Release_x64_D3D:
   Release_x64_D3D:
     name: "Release_x64_D3D"
     name: "Release_x64_D3D"
-    runs-on: windows-latest
+    runs-on: windows-2025
 
 
     steps:
     steps:
     - name: Clone
     - name: Clone
@@ -93,7 +93,7 @@ jobs:
 
 
   DLSS_x64:
   DLSS_x64:
     name: "DLSS_x64"
     name: "DLSS_x64"
-    runs-on: windows-latest
+    runs-on: windows-2025
 
 
     steps:
     steps:
     - name: Clone
     - name: Clone

+ 1 - 1
AnKi/Renderer/IndirectDiffuseClipmaps.cpp

@@ -530,7 +530,7 @@ void IndirectDiffuseClipmaps::populateRenderGraph(RenderingContext& ctx)
 		pass.newTextureDependency(halfHandle, TextureUsageBit::kSrvCompute);
 		pass.newTextureDependency(halfHandle, TextureUsageBit::kSrvCompute);
 		pass.newTextureDependency(fullHandle, TextureUsageBit::kUavCompute);
 		pass.newTextureDependency(fullHandle, TextureUsageBit::kUavCompute);
 
 
-		pass.setWork([this, &ctx, halfHandle, fullHandle](RenderPassWorkContext& rgraphCtx) {
+		pass.setWork([this, halfHandle, fullHandle](RenderPassWorkContext& rgraphCtx) {
 			CommandBuffer& cmdb = *rgraphCtx.m_commandBuffer;
 			CommandBuffer& cmdb = *rgraphCtx.m_commandBuffer;
 
 
 			cmdb.bindShaderProgram(m_spatialReconstructGrProg.get());
 			cmdb.bindShaderProgram(m_spatialReconstructGrProg.get());

+ 0 - 1
AnKi/Scene/Components/TriggerComponent.cpp

@@ -61,7 +61,6 @@ TriggerComponent::MyPhysicsTriggerCallbacks TriggerComponent::m_callbacks;
 
 
 TriggerComponent::TriggerComponent(SceneNode* node)
 TriggerComponent::TriggerComponent(SceneNode* node)
 	: SceneComponent(node, kClassType)
 	: SceneComponent(node, kClassType)
-	, m_node(node)
 {
 {
 }
 }
 
 

+ 0 - 2
AnKi/Scene/Components/TriggerComponent.h

@@ -46,8 +46,6 @@ public:
 private:
 private:
 	class MyPhysicsTriggerCallbacks;
 	class MyPhysicsTriggerCallbacks;
 
 
-	SceneNode* m_node;
-
 	PhysicsCollisionShapePtr m_shape;
 	PhysicsCollisionShapePtr m_shape;
 	PhysicsBodyPtr m_trigger;
 	PhysicsBodyPtr m_trigger;
 
 

+ 1 - 1
AnKi/Shaders/Include/GpuVisibilityTypes.h

@@ -97,7 +97,7 @@ enum class GpuVisibilityIndirectDispatches : U32
 };
 };
 
 
 /// Counters used in non-renderables visibility
 /// Counters used in non-renderables visibility
-class GpuVisibilityNonRenderablesCounters
+struct GpuVisibilityNonRenderablesCounters
 {
 {
 	U32 m_threadgroupCount; ///< Counts the no of threadgroups
 	U32 m_threadgroupCount; ///< Counts the no of threadgroups
 	U32 m_visibleObjectCount; ///< Counts the visible objects
 	U32 m_visibleObjectCount; ///< Counts the visible objects

+ 10 - 11
CMakeLists.txt

@@ -287,23 +287,22 @@ else()
 	add_compile_options(/FC)
 	add_compile_options(/FC)
 endif()
 endif()
 
 
-# Use LLD or gold linker
+# Use LLD or mold linker
 if(UNIX AND NOT APPLE)
 if(UNIX AND NOT APPLE)
 	execute_process(COMMAND ${CMAKE_C_COMPILER} -fuse-ld=lld -Wl,--version ERROR_QUIET OUTPUT_VARIABLE ld_version)
 	execute_process(COMMAND ${CMAKE_C_COMPILER} -fuse-ld=lld -Wl,--version ERROR_QUIET OUTPUT_VARIABLE ld_version)
-	if("${ld_version}" MATCHES "compatible with GNU linkers" AND "${ld_version}" MATCHES "LLD")
+	execute_process(COMMAND ${CMAKE_C_COMPILER} -fuse-ld=mold -Wl,--version ERROR_QUIET OUTPUT_VARIABLE mold_version)
+
+	if("${mold_version}" MATCHES "compatible with GNU")
+		message("++ Will use mold linker")
+		set(CMAKE_LINKER_TYPE "MOLD")
+	elseif("${ld_version}" MATCHES "compatible with GNU linkers")
 		message("++ Will use LLD linker")
 		message("++ Will use LLD linker")
-		set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fuse-ld=lld -Wl,--disable-new-dtags")
-		set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -fuse-ld=lld -Wl,--disable-new-dtags")
-	else()
-		execute_process(COMMAND ${CMAKE_C_COMPILER} -fuse-ld=gold -Wl,--version ERROR_QUIET OUTPUT_VARIABLE ld_version)
-		if("${ld_version}" MATCHES "GNU gold")
-			message("++ Will use gold linker")
-			set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fuse-ld=gold -Wl,--disable-new-dtags")
-			set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -fuse-ld=gold -Wl,--disable-new-dtags")
-		endif()
+		set(CMAKE_LINKER_TYPE "LLD")
 	endif()
 	endif()
 endif()
 endif()
 
 
+set(CMAKE_INTERPROCEDURAL_OPTIMIZATION ON)
+
 ################################################################################
 ################################################################################
 # Thirdparty                                                                   #
 # Thirdparty                                                                   #
 ################################################################################
 ################################################################################

+ 9 - 19
README.md

@@ -11,8 +11,7 @@
 1 License
 1 License
 =========
 =========
 
 
-AnKi's license is `BSD`. This practically means that you can use the source or parts of the source on proprietary and
-non proprietary products as long as you follow the conditions of the license.
+AnKi's license is `BSD`. This practically means that you can use the source or parts of the source on proprietary and non proprietary products as long as you follow the conditions of the license.
 
 
 See the [LICENSE](LICENSE) file for more info.
 See the [LICENSE](LICENSE) file for more info.
 
 
@@ -35,20 +34,16 @@ To checkout the source type:
 
 
 	git clone https://github.com/godlikepanos/anki-3d-engine.git anki
 	git clone https://github.com/godlikepanos/anki-3d-engine.git anki
 
 
-AnKi's build system is using `CMake`. A great effort was made to ease the building process that's why the number of
-external dependencies are almost none.
+AnKi's build system is using `CMake`. A great effort was made to ease the building process that's why the number of external dependencies are almost none.
 
 
 3.1 On Linux
 3.1 On Linux
 ------------
 ------------
 
 
 Prerequisites:
 Prerequisites:
 
 
-- Cmake 3.10 and up
-- GCC 5.0 and up or Clang 6.0 and up
-- libx11-dev installed
-- libxrandr-dev installed
-- libx11-xcb-dev installed
-- [Optional] libxinerama-dev if you want proper multi-monitor support
+- Cmake 3.15 and up
+- GCC 12.0 and up or Clang 18.0 and up
+- Various dev libaries. To install them all in one go just install `libsdl2-dev` or `libsdl3-dev` (AnKi has the same dependencies as SDL).
 
 
 To build the release version:
 To build the release version:
 
 
@@ -100,9 +95,7 @@ Prerequisites:
 - From Android Studio's package manager you need to install `NDK` and `CMake`
 - From Android Studio's package manager you need to install `NDK` and `CMake`
 - Having built AnKi for your host operating system (Linux or Windows)
 - Having built AnKi for your host operating system (Linux or Windows)
 
 
-Android builds work a bit differently from Linux and Windows. First you need to have built AnKi for your host operating
-system. That's because Android builds requires the `ShaderCompiler/ShaderCompiler.exe` to compile the shaders for
-Android. Then you have to generate a gradle project per build target.
+Android builds work a bit differently from Linux and Windows. First you need to have built AnKi for your host operating system. That's because Android builds requires the `ShaderCompiler/ShaderCompiler.exe` to compile the shaders for Android. Then you have to generate a gradle project per build target.
 
 
 For example, if you want to generate a project for the `Sponza` sample just type from a Linux terminal:
 For example, if you want to generate a project for the `Sponza` sample just type from a Linux terminal:
 
 
@@ -114,8 +107,7 @@ or from a PowerShell terminal on Windows:
 	$cd path/to/anki
 	$cd path/to/anki
 	$./Samples/Sponza/GenerateAndroidProject.bat path/to/Binaries/ShaderCompiler.exe
 	$./Samples/Sponza/GenerateAndroidProject.bat path/to/Binaries/ShaderCompiler.exe
 
 
-The `GenerateAndroidProject` scripts will generate a project in the root directory of AnKi. So for the `Sponza` sample
-the script will create a directory named `AndroidProject_Sponza`.
+The `GenerateAndroidProject` scripts will generate a project in the root directory of AnKi. So for the `Sponza` sample the script will create a directory named `AndroidProject_Sponza`.
 
 
 Then you can open the `AndroidProject_Sponza` project from `Android Studio` and build it, debug it, run it etc.
 Then you can open the `AndroidProject_Sponza` project from `Android Studio` and build it, debug it, run it etc.
 
 
@@ -129,15 +121,13 @@ This code repository contains **4 sample projects** that are built by default (`
 - `PhysicsPlayground`: A scene with programmer's art and some physics interactions
 - `PhysicsPlayground`: A scene with programmer's art and some physics interactions
 - `SkeletalAnimation`: A simple scene with an animated skin
 - `SkeletalAnimation`: A simple scene with an animated skin
 
 
-You can try running them and interacting with them. To run sponza, for example, execute the binary from any working
-directory.
+You can try running them and interacting with them. To run sponza, for example, execute the binary from any working directory.
 
 
 On Linux:
 On Linux:
 
 
 	$./path/to/build/Binaries/Sponza
 	$./path/to/build/Binaries/Sponza
 
 
-On Windows just find the `Sponza.exe` and execute it. It's preferable to run the samples from a terminal because that
-prints some information, including possible errors.
+On Windows just find the `Sponza.exe` and execute it. It's preferable to run the samples from a terminal because that prints some information, including possible errors.
 
 
 5 Contributing
 5 Contributing
 ==============
 ==============