From b70ab01308fec3eca83b63cd342d7f895e7374ab Mon Sep 17 00:00:00 2001 From: Ari Vuollet Date: Tue, 16 Dec 2025 01:18:30 +0200 Subject: [PATCH 01/26] Fix duplicate properties for default configuration in C# projects --- .../Flax.Build/Projects/VisualStudio/CSSDKProjectGenerator.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Source/Tools/Flax.Build/Projects/VisualStudio/CSSDKProjectGenerator.cs b/Source/Tools/Flax.Build/Projects/VisualStudio/CSSDKProjectGenerator.cs index 671cfb5e8..ce3903874 100644 --- a/Source/Tools/Flax.Build/Projects/VisualStudio/CSSDKProjectGenerator.cs +++ b/Source/Tools/Flax.Build/Projects/VisualStudio/CSSDKProjectGenerator.cs @@ -132,6 +132,8 @@ namespace Flax.Build.Projects.VisualStudio // Configurations foreach (var configuration in project.Configurations) { + if (configuration.Equals(defaultConfiguration)) + continue; WriteConfiguration(project, csProjectFileContent, projectDirectory, configuration); } From 1327fa40cbeefe3ecb86d4d42130bb0d4bfdc5a2 Mon Sep 17 00:00:00 2001 From: Ari Vuollet Date: Tue, 16 Dec 2025 01:20:49 +0200 Subject: [PATCH 02/26] Run editor with selected project configuration in launchSettings.json --- .../Flax.Build/Projects/VisualStudio/CSSDKProjectGenerator.cs | 1 + .../Projects/VisualStudio/VisualStudioProjectGenerator.cs | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Source/Tools/Flax.Build/Projects/VisualStudio/CSSDKProjectGenerator.cs b/Source/Tools/Flax.Build/Projects/VisualStudio/CSSDKProjectGenerator.cs index ce3903874..ffc95e047 100644 --- a/Source/Tools/Flax.Build/Projects/VisualStudio/CSSDKProjectGenerator.cs +++ b/Source/Tools/Flax.Build/Projects/VisualStudio/CSSDKProjectGenerator.cs @@ -311,6 +311,7 @@ namespace Flax.Build.Projects.VisualStudio } csProjectFileContent.AppendLine(string.Format(" {0}\\{1}.CSharp.xml", outputPath, project.BaseName)); csProjectFileContent.AppendLine(" true"); + csProjectFileContent.AppendLine(string.Format(" {0}", configuration.ConfigurationName)); csProjectFileContent.AppendLine(" "); diff --git a/Source/Tools/Flax.Build/Projects/VisualStudio/VisualStudioProjectGenerator.cs b/Source/Tools/Flax.Build/Projects/VisualStudio/VisualStudioProjectGenerator.cs index d657f6247..34dc3f380 100644 --- a/Source/Tools/Flax.Build/Projects/VisualStudio/VisualStudioProjectGenerator.cs +++ b/Source/Tools/Flax.Build/Projects/VisualStudio/VisualStudioProjectGenerator.cs @@ -630,7 +630,7 @@ namespace Flax.Build.Projects.VisualStudio { var profiles = new Dictionary(); var profile = new StringBuilder(); - var configuration = "Development"; + var configuration = "$(FlaxConfiguration)"; var editorPath = Utilities.NormalizePath(Path.Combine(Globals.EngineRoot, Platform.GetEditorBinaryDirectory(), configuration, $"FlaxEditor{Utilities.GetPlatformExecutableExt()}")).Replace('\\', '/'); var workspacePath = Utilities.NormalizePath(solutionDirectory).Replace('\\', '/'); foreach (var project in projects) From 8db29a30e0372f9f07281aea153ec2a7a931a2d4 Mon Sep 17 00:00:00 2001 From: Ari Vuollet Date: Sun, 20 Apr 2025 01:11:29 +0300 Subject: [PATCH 03/26] Fix VC++ project file building on macOS Rider --- .../Flax.Build/Projects/VisualStudio/VCProjectGenerator.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Source/Tools/Flax.Build/Projects/VisualStudio/VCProjectGenerator.cs b/Source/Tools/Flax.Build/Projects/VisualStudio/VCProjectGenerator.cs index 1a52274a7..371cf3933 100644 --- a/Source/Tools/Flax.Build/Projects/VisualStudio/VCProjectGenerator.cs +++ b/Source/Tools/Flax.Build/Projects/VisualStudio/VCProjectGenerator.cs @@ -115,6 +115,7 @@ namespace Flax.Build.Projects.VisualStudio if (Version >= VisualStudioVersion.VisualStudio2022) vcProjectFileContent.AppendLine(" false"); vcProjectFileContent.AppendLine(" ./"); + vcProjectFileContent.AppendLine(" ./"); vcProjectFileContent.AppendLine(" "); // Default properties @@ -377,9 +378,9 @@ namespace Flax.Build.Projects.VisualStudio vcUserFileContent.AppendLine(""); - if (platforms.Any(x => x.Target == TargetPlatform.Linux)) + if (platforms.Any(x => x.Target == TargetPlatform.Linux || x.Target == TargetPlatform.Mac)) { - // Override MSBuild .targets file with one that runs NMake commands (workaround for Rider on Linux) + // Override MSBuild .targets file with one that runs NMake commands (workaround for Rider not finding "Microsoft.Cpp.Default.props" file) var cppTargetsFileContent = new StringBuilder(); cppTargetsFileContent.AppendLine(""); cppTargetsFileContent.AppendLine(" "); From 518f9dc9dc5598eb10a31c77e76cd6174c7b5b84 Mon Sep 17 00:00:00 2001 From: Ari Vuollet Date: Wed, 17 Dec 2025 02:14:22 +0200 Subject: [PATCH 04/26] Launch editor when debugging VC++ projects in Rider Linux/macOS --- .../Projects/VisualStudio/VCProjectGenerator.cs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Source/Tools/Flax.Build/Projects/VisualStudio/VCProjectGenerator.cs b/Source/Tools/Flax.Build/Projects/VisualStudio/VCProjectGenerator.cs index 371cf3933..290d194cf 100644 --- a/Source/Tools/Flax.Build/Projects/VisualStudio/VCProjectGenerator.cs +++ b/Source/Tools/Flax.Build/Projects/VisualStudio/VCProjectGenerator.cs @@ -380,6 +380,10 @@ namespace Flax.Build.Projects.VisualStudio if (platforms.Any(x => x.Target == TargetPlatform.Linux || x.Target == TargetPlatform.Mac)) { + var editorPath = Utilities.NormalizePath(Path.Combine(Globals.EngineRoot, Platform.GetEditorBinaryDirectory(), "$(Configuration.Split('.')[2])", $"FlaxEditor{Utilities.GetPlatformExecutableExt()}")).Replace('\\', '/'); + var debuggerProjectPath = Globals.Project.Name == "Flax" ? "" : Globals.Project.ProjectFolderPath; + var debuggerWorkingDirectory = Globals.Project.ProjectFolderPath; + // Override MSBuild .targets file with one that runs NMake commands (workaround for Rider not finding "Microsoft.Cpp.Default.props" file) var cppTargetsFileContent = new StringBuilder(); cppTargetsFileContent.AppendLine(""); @@ -396,6 +400,12 @@ namespace Flax.Build.Projects.VisualStudio cppTargetsFileContent.AppendLine(" "); cppTargetsFileContent.AppendLine(" $(RootNamespace)$(Configuration.Split('.')[0])"); cppTargetsFileContent.AppendLine(" $(OutDir)/$(TargetName)$(TargetExt)"); + if (!string.IsNullOrEmpty(debuggerProjectPath)) + cppTargetsFileContent.AppendLine(string.Format(" -project \"{0}\"", debuggerProjectPath)); + else + cppTargetsFileContent.AppendLine(" "); + cppTargetsFileContent.AppendLine(string.Format(" {0}", editorPath)); + cppTargetsFileContent.AppendLine(string.Format(" {0}", debuggerWorkingDirectory)); cppTargetsFileContent.AppendLine(" "); cppTargetsFileContent.AppendLine(""); From f14ba6ace6e88f2b56e982e5ada126a7641f9c55 Mon Sep 17 00:00:00 2001 From: Ari Vuollet Date: Wed, 17 Dec 2025 02:15:09 +0200 Subject: [PATCH 05/26] Fix Flax C#-project launchSettings.json to launch without project --- .../Projects/VisualStudio/VisualStudioProjectGenerator.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Source/Tools/Flax.Build/Projects/VisualStudio/VisualStudioProjectGenerator.cs b/Source/Tools/Flax.Build/Projects/VisualStudio/VisualStudioProjectGenerator.cs index d657f6247..6a573e0fd 100644 --- a/Source/Tools/Flax.Build/Projects/VisualStudio/VisualStudioProjectGenerator.cs +++ b/Source/Tools/Flax.Build/Projects/VisualStudio/VisualStudioProjectGenerator.cs @@ -633,6 +633,7 @@ namespace Flax.Build.Projects.VisualStudio var configuration = "Development"; var editorPath = Utilities.NormalizePath(Path.Combine(Globals.EngineRoot, Platform.GetEditorBinaryDirectory(), configuration, $"FlaxEditor{Utilities.GetPlatformExecutableExt()}")).Replace('\\', '/'); var workspacePath = Utilities.NormalizePath(solutionDirectory).Replace('\\', '/'); + var args = Globals.Project.Name == "Flax" ? "" : $"-project \\\"{workspacePath}\\\""; foreach (var project in projects) { if (project.Type == TargetType.DotNetCore) @@ -645,7 +646,7 @@ namespace Flax.Build.Projects.VisualStudio profile.AppendLine(" \"commandName\": \"Executable\","); profile.AppendLine($" \"workingDirectory\": \"{workspacePath}\","); profile.AppendLine($" \"executablePath\": \"{editorPath}\","); - profile.AppendLine($" \"commandLineArgs\": \"-project \\\"{workspacePath}\\\"\","); + profile.AppendLine($" \"commandLineArgs\": \"{args}\","); profile.AppendLine(" \"nativeDebugging\": false"); profile.Append(" }"); if (profiles.ContainsKey(path)) From 4504d0ae96a274951742ec50fa0749f6de8a0499 Mon Sep 17 00:00:00 2001 From: Chandler Cox Date: Tue, 16 Dec 2025 18:22:26 -0600 Subject: [PATCH 06/26] Fix compute distance crash if no closest point param is defined. --- Source/Engine/Physics/PhysX/PhysicsBackendPhysX.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Source/Engine/Physics/PhysX/PhysicsBackendPhysX.cpp b/Source/Engine/Physics/PhysX/PhysicsBackendPhysX.cpp index 18929ab73..3edfaa0c6 100644 --- a/Source/Engine/Physics/PhysX/PhysicsBackendPhysX.cpp +++ b/Source/Engine/Physics/PhysX/PhysicsBackendPhysX.cpp @@ -2787,7 +2787,8 @@ float PhysicsBackend::ComputeShapeSqrDistanceToPoint(void* shape, const Vector3& #if USE_LARGE_WORLDS PxVec3 closestPointPx; float result = PxGeometryQuery::pointDistance(C2P(point), shapePhysX->getGeometry(), trans, &closestPointPx); - *closestPoint = P2C(closestPointPx); + if (closestPoint) + *closestPoint = P2C(closestPointPx); return result; #else return PxGeometryQuery::pointDistance(C2P(point), shapePhysX->getGeometry(), trans, (PxVec3*)closestPoint); From 2a959d0531bd034f2755983b9d826c40695c87c1 Mon Sep 17 00:00:00 2001 From: Ari Vuollet Date: Sun, 12 Oct 2025 14:42:22 +0300 Subject: [PATCH 07/26] Support Visual Studio 2026 as a generator for CMake dependencies --- .../Tools/Flax.Build/Deploy/VCEnvironment.cs | 6 ++++- Source/Tools/Flax.Build/Deps/Dependency.cs | 26 ++++++++++++++++++- 2 files changed, 30 insertions(+), 2 deletions(-) diff --git a/Source/Tools/Flax.Build/Deploy/VCEnvironment.cs b/Source/Tools/Flax.Build/Deploy/VCEnvironment.cs index cfcbf9866..afe5c8e3c 100644 --- a/Source/Tools/Flax.Build/Deploy/VCEnvironment.cs +++ b/Source/Tools/Flax.Build/Deploy/VCEnvironment.cs @@ -241,7 +241,11 @@ namespace Flax.Deploy if (!File.Exists(solutionFile)) { - throw new Exception(string.Format("Unable to build solution {0}. Solution file not found.", solutionFile)); + // CMake VS2026 generator prefers .slnx solution files, just swap the extension for CMake dependencies + if (File.Exists(Path.ChangeExtension(solutionFile, "slnx"))) + solutionFile = Path.ChangeExtension(solutionFile, "slnx"); + else + throw new Exception(string.Format("Unable to build solution {0}. Solution file not found.", solutionFile)); } string cmdLine = string.Format("\"{0}\" /m /t:Restore,Build /p:Configuration=\"{1}\" /p:Platform=\"{2}\" {3} /nologo", solutionFile, buildConfig, buildPlatform, Verbosity); diff --git a/Source/Tools/Flax.Build/Deps/Dependency.cs b/Source/Tools/Flax.Build/Deps/Dependency.cs index 43cdcc146..010a45175 100644 --- a/Source/Tools/Flax.Build/Deps/Dependency.cs +++ b/Source/Tools/Flax.Build/Deps/Dependency.cs @@ -47,6 +47,24 @@ namespace Flax.Deps /// protected static TargetPlatform BuildPlatform => Platform.BuildPlatform.Target; + + private static Version? _cmakeVersion; + protected static Version CMakeVersion + { + get + { + if (_cmakeVersion == null) + { + var versionOutput = Utilities.ReadProcessOutput("cmake", "--version"); + var versionStart = versionOutput.IndexOf("cmake version ") + "cmake version ".Length; + var versionEnd = versionOutput.IndexOfAny(['-', '\n', '\r'], versionStart); // End of line or dash before Git hash + var versionString = versionOutput.Substring(versionStart, versionEnd - versionStart); + _cmakeVersion = new Version(versionString); + } + return _cmakeVersion; + } + } + /// /// Gets the platforms list supported by this dependency to build on the current build platform (based on ). /// @@ -309,7 +327,13 @@ namespace Flax.Deps break; default: throw new InvalidArchitectureException(architecture); } - cmdLine = string.Format("CMakeLists.txt -G \"Visual Studio 17 2022\" -A {0}", arch); + if (CMakeVersion.Major > 4 || (CMakeVersion.Major == 4 && CMakeVersion.Minor >= 2)) + { + // This generates both .sln and .slnx solution files + cmdLine = string.Format("CMakeLists.txt -G \"Visual Studio 17 2022\" -G \"Visual Studio 18 2026\" -A {0}", arch); + } + else + cmdLine = string.Format("CMakeLists.txt -G \"Visual Studio 17 2022\" -A {0}", arch); break; } case TargetPlatform.PS4: From d64c28f6726387e56cbfa344a1200e1122946156 Mon Sep 17 00:00:00 2001 From: Ari Vuollet Date: Fri, 19 Dec 2025 00:03:41 +0200 Subject: [PATCH 08/26] Fix compilation errors with `/permissive-` standard conformance mode --- Source/Engine/GraphicsDevice/DirectX/DX11/GPUTextureDX11.cpp | 2 +- Source/Engine/GraphicsDevice/DirectX/DX12/GPUDeviceDX12.h | 2 +- Source/Engine/GraphicsDevice/DirectX/DX12/GPUTextureDX12.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Source/Engine/GraphicsDevice/DirectX/DX11/GPUTextureDX11.cpp b/Source/Engine/GraphicsDevice/DirectX/DX11/GPUTextureDX11.cpp index a05585696..bce8271db 100644 --- a/Source/Engine/GraphicsDevice/DirectX/DX11/GPUTextureDX11.cpp +++ b/Source/Engine/GraphicsDevice/DirectX/DX11/GPUTextureDX11.cpp @@ -553,7 +553,7 @@ void GPUTextureDX11::initHandles() if (useDSV && useSRV && PixelFormatExtensions::HasStencil(format)) { PixelFormat stencilFormat; - switch (_dxgiFormatDSV) + switch (static_cast(_dxgiFormatDSV)) { case PixelFormat::D24_UNorm_S8_UInt: srDesc.Format = DXGI_FORMAT_X24_TYPELESS_G8_UINT; diff --git a/Source/Engine/GraphicsDevice/DirectX/DX12/GPUDeviceDX12.h b/Source/Engine/GraphicsDevice/DirectX/DX12/GPUDeviceDX12.h index bb5d53458..e9c1cacaa 100644 --- a/Source/Engine/GraphicsDevice/DirectX/DX12/GPUDeviceDX12.h +++ b/Source/Engine/GraphicsDevice/DirectX/DX12/GPUDeviceDX12.h @@ -210,7 +210,7 @@ public: /// The graphics device. /// The resource name. GPUResourceDX12(GPUDeviceDX12* device, const StringView& name) - : GPUResourceBase(device, name) + : GPUResourceBase(device, name) { } }; diff --git a/Source/Engine/GraphicsDevice/DirectX/DX12/GPUTextureDX12.cpp b/Source/Engine/GraphicsDevice/DirectX/DX12/GPUTextureDX12.cpp index a4fbc683d..eada546e3 100644 --- a/Source/Engine/GraphicsDevice/DirectX/DX12/GPUTextureDX12.cpp +++ b/Source/Engine/GraphicsDevice/DirectX/DX12/GPUTextureDX12.cpp @@ -732,7 +732,7 @@ void GPUTextureDX12::initHandles() if (useDSV && useSRV && PixelFormatExtensions::HasStencil(format)) { PixelFormat stencilFormat; - switch (_dxgiFormatDSV) + switch (static_cast(_dxgiFormatDSV)) { case PixelFormat::D24_UNorm_S8_UInt: srDesc.Format = DXGI_FORMAT_X24_TYPELESS_G8_UINT; From c0b54be6922648bc0d68f10a8640ff427c6d1d58 Mon Sep 17 00:00:00 2001 From: Ari Vuollet Date: Tue, 16 Dec 2025 00:53:03 +0200 Subject: [PATCH 09/26] Fix clang bindings code generation for non-const ref parameters --- .../Flax.Build/Bindings/BindingsGenerator.Cpp.cs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/Source/Tools/Flax.Build/Bindings/BindingsGenerator.Cpp.cs b/Source/Tools/Flax.Build/Bindings/BindingsGenerator.Cpp.cs index 190036af4..8554152fb 100644 --- a/Source/Tools/Flax.Build/Bindings/BindingsGenerator.Cpp.cs +++ b/Source/Tools/Flax.Build/Bindings/BindingsGenerator.Cpp.cs @@ -1293,11 +1293,21 @@ namespace Flax.Build.Bindings callParams += parameterInfo.Name; callParams += "Temp"; } - // Instruct for more optoimized value move operation + // Instruct for more optimized value move operation else if (parameterInfo.Type.IsMoveRef) { callParams += $"MoveTemp({param})"; } + else if (parameterInfo.Type.IsRef && !parameterInfo.Type.IsConst) + { + // Non-const lvalue reference parameters needs to be passed via temporary value + if (parameterInfo.IsOut || parameterInfo.IsRef) + contents.Append(indent).AppendFormat("{2}& {0}Temp = {1};", parameterInfo.Name, param, parameterInfo.Type.ToString(false)).AppendLine(); + else + contents.Append(indent).AppendFormat("{2} {0}Temp = {1};", parameterInfo.Name, param, parameterInfo.Type.ToString(false)).AppendLine(); + callParams += parameterInfo.Name; + callParams += "Temp"; + } else { callParams += param; From 518a19c857c3333a51af14493995f93bd2b1229b Mon Sep 17 00:00:00 2001 From: Ari Vuollet Date: Tue, 16 Dec 2025 14:27:32 +0200 Subject: [PATCH 10/26] Expose `RenderContext` to scripting API --- Source/Engine/Graphics/RenderTask.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Source/Engine/Graphics/RenderTask.h b/Source/Engine/Graphics/RenderTask.h index 07926fd64..8cba1006e 100644 --- a/Source/Engine/Graphics/RenderTask.h +++ b/Source/Engine/Graphics/RenderTask.h @@ -450,7 +450,7 @@ public: /// /// The high-level renderer context. Used to collect the draw calls for the scene rendering. Can be used to perform a custom rendering. /// -API_STRUCT(NoDefault) struct RenderContext +API_STRUCT(NoDefault) struct FLAXENGINE_API RenderContext { DECLARE_SCRIPTING_TYPE_MINIMAL(RenderContext); @@ -491,7 +491,7 @@ API_STRUCT(NoDefault) struct RenderContext /// /// The high-level renderer context batch that encapsulates multiple rendering requests within a single task (eg. optimize main view scene rendering and shadow projections at once). /// -API_STRUCT(NoDefault) struct RenderContextBatch +API_STRUCT(NoDefault) struct FLAXENGINE_API RenderContextBatch { DECLARE_SCRIPTING_TYPE_MINIMAL(RenderContextBatch); From f95cbb0e52e1802ff8193bc637f4531a3913b588 Mon Sep 17 00:00:00 2001 From: Ari Vuollet Date: Tue, 16 Dec 2025 14:29:42 +0200 Subject: [PATCH 11/26] Fix missing exports for managed converter structures --- Source/Tools/Flax.Build/Bindings/BindingsGenerator.Cpp.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Source/Tools/Flax.Build/Bindings/BindingsGenerator.Cpp.cs b/Source/Tools/Flax.Build/Bindings/BindingsGenerator.Cpp.cs index 8554152fb..33f9d3514 100644 --- a/Source/Tools/Flax.Build/Bindings/BindingsGenerator.Cpp.cs +++ b/Source/Tools/Flax.Build/Bindings/BindingsGenerator.Cpp.cs @@ -3005,7 +3005,7 @@ namespace Flax.Build.Bindings // Generate MConverter for a structure header.Append("template<>").AppendLine(); - header.AppendFormat("struct MConverter<{0}>", fullName).AppendLine(); + header.AppendFormat("struct DLLEXPORT MConverter<{0}>", fullName).AppendLine(); header.Append('{').AppendLine(); header.AppendFormat(" MObject* Box(const {0}& data, const MClass* klass)", fullName).AppendLine(); header.Append(" {").AppendLine(); @@ -3115,7 +3115,7 @@ namespace Flax.Build.Bindings { // Generate MConverter for a class header.Append("template<>").AppendLine(); - header.AppendFormat("struct MConverter<{0}>", fullName).AppendLine(); + header.AppendFormat("struct DLLEXPORT MConverter<{0}>", fullName).AppendLine(); header.Append('{').AppendLine(); header.AppendFormat(" static MObject* Box(const {0}& data, const MClass* klass)", fullName).AppendLine(); From 52e2327527bde83806f2de052b16e45aae6cc877 Mon Sep 17 00:00:00 2001 From: Ari Vuollet Date: Tue, 16 Dec 2025 21:11:36 +0200 Subject: [PATCH 12/26] Add `USED` attribute for forcing compiler to emit the symbol --- Source/Engine/Core/Compiler.h | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/Source/Engine/Core/Compiler.h b/Source/Engine/Core/Compiler.h index a45a4628a..d84713857 100644 --- a/Source/Engine/Core/Compiler.h +++ b/Source/Engine/Core/Compiler.h @@ -4,8 +4,9 @@ #if defined(__clang__) -#define DLLEXPORT __attribute__ ((__visibility__ ("default"))) +#define DLLEXPORT __attribute__((__visibility__("default"))) #define DLLIMPORT +#define USED __attribute__((used)) #define THREADLOCAL __thread #define STDCALL __attribute__((stdcall)) #define CDECL __attribute__((cdecl)) @@ -19,7 +20,7 @@ #define PACK_BEGIN() #define PACK_END() __attribute__((__packed__)) #define ALIGN_BEGIN(_align) -#define ALIGN_END(_align) __attribute__( (aligned(_align) ) ) +#define ALIGN_END(_align) __attribute__((aligned(_align))) #define OFFSET_OF(X, Y) __builtin_offsetof(X, Y) #define PRAGMA_DISABLE_DEPRECATION_WARNINGS \ _Pragma("clang diagnostic push") \ @@ -37,8 +38,9 @@ #elif defined(__GNUC__) -#define DLLEXPORT __attribute__ ((__visibility__ ("default"))) +#define DLLEXPORT __attribute__((__visibility__("default"))) #define DLLIMPORT +#define USED __attribute__((used)) #define THREADLOCAL __thread #define STDCALL __attribute__((stdcall)) #define CDECL __attribute__((cdecl)) @@ -52,7 +54,7 @@ #define PACK_BEGIN() #define PACK_END() __attribute__((__packed__)) #define ALIGN_BEGIN(_align) -#define ALIGN_END(_align) __attribute__( (aligned(_align) ) ) +#define ALIGN_END(_align) __attribute__((aligned(_align))) #define OFFSET_OF(X, Y) __builtin_offsetof(X, Y) #define PRAGMA_DISABLE_DEPRECATION_WARNINGS #define PRAGMA_ENABLE_DEPRECATION_WARNINGS @@ -67,6 +69,7 @@ #define DLLEXPORT __declspec(dllexport) #define DLLIMPORT __declspec(dllimport) +#define USED #define THREADLOCAL __declspec(thread) #define STDCALL __stdcall #define CDECL __cdecl From 3eb690fe58918d31df3ac4361cb672336b93da4b Mon Sep 17 00:00:00 2001 From: Ari Vuollet Date: Tue, 16 Dec 2025 21:13:00 +0200 Subject: [PATCH 13/26] Ensure managed converter functions are exported with optimizations --- .../Bindings/BindingsGenerator.Cpp.cs | 28 +++++++++++-------- 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/Source/Tools/Flax.Build/Bindings/BindingsGenerator.Cpp.cs b/Source/Tools/Flax.Build/Bindings/BindingsGenerator.Cpp.cs index 33f9d3514..570ca4dcc 100644 --- a/Source/Tools/Flax.Build/Bindings/BindingsGenerator.Cpp.cs +++ b/Source/Tools/Flax.Build/Bindings/BindingsGenerator.Cpp.cs @@ -3005,18 +3005,21 @@ namespace Flax.Build.Bindings // Generate MConverter for a structure header.Append("template<>").AppendLine(); - header.AppendFormat("struct DLLEXPORT MConverter<{0}>", fullName).AppendLine(); + header.AppendFormat("struct MConverter<{0}>", fullName).AppendLine(); header.Append('{').AppendLine(); - header.AppendFormat(" MObject* Box(const {0}& data, const MClass* klass)", fullName).AppendLine(); + + header.AppendFormat(" DLLEXPORT USED MObject* Box(const {0}& data, const MClass* klass)", fullName).AppendLine(); header.Append(" {").AppendLine(); header.Append(" auto managed = ToManaged(data);").AppendLine(); header.Append(" return MCore::Object::Box((void*)&managed, klass);").AppendLine(); header.Append(" }").AppendLine(); - header.AppendFormat(" void Unbox({0}& result, MObject* data)", fullName).AppendLine(); + + header.AppendFormat(" DLLEXPORT USED void Unbox({0}& result, MObject* data)", fullName).AppendLine(); header.Append(" {").AppendLine(); header.AppendFormat(" result = ToNative(*reinterpret_cast<{0}*>(MCore::Object::Unbox(data)));", wrapperName).AppendLine(); header.Append(" }").AppendLine(); - header.AppendFormat(" void ToManagedArray(MArray* result, const Span<{0}>& data)", fullName).AppendLine(); + + header.AppendFormat(" DLLEXPORT USED void ToManagedArray(MArray* result, const Span<{0}>& data)", fullName).AppendLine(); header.Append(" {").AppendLine(); header.AppendFormat(" MClass* klass = {0}::TypeInitializer.GetClass();", fullName).AppendLine(); header.AppendFormat(" {0}* resultPtr = ({0}*)MCore::Array::GetAddress(result);", wrapperName).AppendLine(); @@ -3026,7 +3029,8 @@ namespace Flax.Build.Bindings header.Append(" MCore::GC::WriteValue(&resultPtr[i], &managed, 1, klass);").AppendLine(); header.Append(" }").AppendLine(); header.Append(" }").AppendLine(); - header.AppendFormat(" void ToNativeArray(Span<{0}>& result, const MArray* data)", fullName).AppendLine(); + + header.AppendFormat(" DLLEXPORT USED void ToNativeArray(Span<{0}>& result, const MArray* data)", fullName).AppendLine(); header.Append(" {").AppendLine(); header.AppendFormat(" {0}* dataPtr = ({0}*)MCore::Array::GetAddress(data);", wrapperName).AppendLine(); header.Append(" for (int32 i = 0; i < result.Length(); i++)").AppendLine(); @@ -3115,10 +3119,10 @@ namespace Flax.Build.Bindings { // Generate MConverter for a class header.Append("template<>").AppendLine(); - header.AppendFormat("struct DLLEXPORT MConverter<{0}>", fullName).AppendLine(); + header.AppendFormat("struct MConverter<{0}>", fullName).AppendLine(); header.Append('{').AppendLine(); - header.AppendFormat(" static MObject* Box(const {0}& data, const MClass* klass)", fullName).AppendLine(); + header.AppendFormat(" DLLEXPORT USED static MObject* Box(const {0}& data, const MClass* klass)", fullName).AppendLine(); header.Append(" {").AppendLine(); header.Append(" MObject* obj = MCore::Object::New(klass);").AppendLine(); for (var i = 0; i < fields.Count; i++) @@ -3138,13 +3142,13 @@ namespace Flax.Build.Bindings header.Append(" return obj;").AppendLine(); header.Append(" }").AppendLine(); - header.AppendFormat(" static MObject* Box(const {0}& data)", fullName).AppendLine(); + header.AppendFormat(" DLLEXPORT USED static MObject* Box(const {0}& data)", fullName).AppendLine(); header.Append(" {").AppendLine(); header.AppendFormat(" MClass* klass = {0}::TypeInitializer.GetClass();", fullName).AppendLine(); header.Append(" return Box(data, klass);").AppendLine(); header.Append(" }").AppendLine(); - header.AppendFormat(" static void Unbox({0}& result, MObject* obj)", fullName).AppendLine(); + header.AppendFormat(" DLLEXPORT USED static void Unbox({0}& result, MObject* obj)", fullName).AppendLine(); header.Append(" {").AppendLine(); header.Append(" MClass* klass = MCore::Object::GetClass(obj);").AppendLine(); header.Append(" void* v = nullptr;").AppendLine(); @@ -3166,20 +3170,20 @@ namespace Flax.Build.Bindings } header.Append(" }").AppendLine(); - header.AppendFormat(" static {0} Unbox(MObject* data)", fullName).AppendLine(); + header.AppendFormat(" DLLEXPORT USED static {0} Unbox(MObject* data)", fullName).AppendLine(); header.Append(" {").AppendLine(); header.AppendFormat(" {0} result;", fullName).AppendLine(); header.Append(" Unbox(result, data);").AppendLine(); header.Append(" return result;").AppendLine(); header.Append(" }").AppendLine(); - header.AppendFormat(" void ToManagedArray(MArray* result, const Span<{0}>& data)", fullName).AppendLine(); + header.AppendFormat(" DLLEXPORT USED void ToManagedArray(MArray* result, const Span<{0}>& data)", fullName).AppendLine(); header.Append(" {").AppendLine(); header.Append(" for (int32 i = 0; i < data.Length(); i++)").AppendLine(); header.Append(" MCore::GC::WriteArrayRef(result, Box(data[i]), i);").AppendLine(); header.Append(" }").AppendLine(); - header.AppendFormat(" void ToNativeArray(Span<{0}>& result, const MArray* data)", fullName).AppendLine(); + header.AppendFormat(" DLLEXPORT USED void ToNativeArray(Span<{0}>& result, const MArray* data)", fullName).AppendLine(); header.Append(" {").AppendLine(); header.Append(" MObject** dataPtr = (MObject**)MCore::Array::GetAddress(data);").AppendLine(); header.Append(" for (int32 i = 0; i < result.Length(); i++)").AppendLine(); From dc22fa406150fbbde86083ae614656479448d864 Mon Sep 17 00:00:00 2001 From: Chandler Cox Date: Thu, 18 Dec 2025 21:49:03 -0600 Subject: [PATCH 14/26] Fix blend shape always applying zero weight if default weight is zero. --- Source/Engine/Level/Actors/AnimatedModel.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Source/Engine/Level/Actors/AnimatedModel.cpp b/Source/Engine/Level/Actors/AnimatedModel.cpp index 343710183..f75174f72 100644 --- a/Source/Engine/Level/Actors/AnimatedModel.cpp +++ b/Source/Engine/Level/Actors/AnimatedModel.cpp @@ -668,7 +668,11 @@ void AnimatedModel::RunBlendShapeDeformer(const MeshBase* mesh, MeshDeformationD { if (q.First == blendShape.Name) { - const float weight = q.Second * blendShape.Weight; + float weight = q.Second; + if (!Math::IsZero(blendShape.Weight)) + weight *= blendShape.Weight; + if (Math::IsZero(weight)) + break; blendShapes.Add(Pair(blendShape, weight)); minVertexIndex = Math::Min(minVertexIndex, blendShape.MinVertexIndex); maxVertexIndex = Math::Max(maxVertexIndex, blendShape.MaxVertexIndex); From c68aa3b371c681ff7adde67d13ff482468833a2e Mon Sep 17 00:00:00 2001 From: Chandler Cox Date: Fri, 19 Dec 2025 08:13:24 -0600 Subject: [PATCH 15/26] Remove not needed include that produces ambiguity for the Label class. --- Source/Editor/CustomEditors/Dedicated/RigidBodyEditor.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/Source/Editor/CustomEditors/Dedicated/RigidBodyEditor.cs b/Source/Editor/CustomEditors/Dedicated/RigidBodyEditor.cs index 53dade508..653478ecd 100644 --- a/Source/Editor/CustomEditors/Dedicated/RigidBodyEditor.cs +++ b/Source/Editor/CustomEditors/Dedicated/RigidBodyEditor.cs @@ -1,7 +1,6 @@ // Copyright (c) Wojciech Figat. All rights reserved. using System.Collections.Generic; -using System.Reflection.Emit; using FlaxEditor.CustomEditors.GUI; using FlaxEngine; using FlaxEngine.GUI; From e3f5af530b21513591f686ee959cecd5de2cf9ee Mon Sep 17 00:00:00 2001 From: Ari Vuollet Date: Fri, 19 Dec 2025 23:57:31 +0200 Subject: [PATCH 16/26] Fix incorrect class namespace in bindings class name lookups --- .../Flax.Build/Bindings/BindingsGenerator.Cpp.cs | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/Source/Tools/Flax.Build/Bindings/BindingsGenerator.Cpp.cs b/Source/Tools/Flax.Build/Bindings/BindingsGenerator.Cpp.cs index 190036af4..89e5dcd10 100644 --- a/Source/Tools/Flax.Build/Bindings/BindingsGenerator.Cpp.cs +++ b/Source/Tools/Flax.Build/Bindings/BindingsGenerator.Cpp.cs @@ -387,17 +387,7 @@ namespace Flax.Build.Bindings // Find namespace for this type to build a fullname if (apiType != null) - { - var e = apiType.Parent; - while (!(e is FileInfo)) - { - e = e.Parent; - } - if (e is FileInfo fileInfo && !managedType.StartsWith(fileInfo.Namespace)) - { - managedType = fileInfo.Namespace + '.' + managedType.Replace(".", "+"); - } - } + managedType = apiType.Namespace + '.' + managedType.Replace(".", "+"); // Use runtime lookup from fullname of the C# class return "Scripting::FindClass(\"" + managedType + "\")"; From 90a21696f68d1af5c1e632645fd1df52469d467e Mon Sep 17 00:00:00 2001 From: Phantom Date: Sun, 21 Dec 2025 15:47:52 +0100 Subject: [PATCH 17/26] Fix Linux Dependencies error --- .github/workflows/cd.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index 56d663921..74915c1ef 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -87,7 +87,8 @@ jobs: git ${{ env.GIT_LFS_PULL_OPTIONS }} lfs pull - name: Install dependencies run: | - sudo apt-get install libx11-dev libxcursor-dev libxinerama-dev build-essential gettext libtool libtool-bin libpulse-dev libasound2-dev libjack-dev portaudio19-dev + sudo apt-get update + sudo apt-get install -y libx11-dev libxcursor-dev libxinerama-dev build-essential gettext libtool libtool-bin libpulse-dev libasound2-dev libjack-dev portaudio19-dev - name: Setup Vulkan uses: ./.github/actions/vulkan - name: Setup .NET @@ -118,7 +119,8 @@ jobs: git ${{ env.GIT_LFS_PULL_OPTIONS }} lfs pull - name: Install dependencies run: | - sudo apt-get install libx11-dev libxcursor-dev libxinerama-dev build-essential gettext libtool libtool-bin libpulse-dev libasound2-dev libjack-dev portaudio19-dev + sudo apt-get update + sudo apt-get install -y libx11-dev libxcursor-dev libxinerama-dev build-essential gettext libtool libtool-bin libpulse-dev libasound2-dev libjack-dev portaudio19-dev - name: Setup Vulkan uses: ./.github/actions/vulkan - name: Setup .NET From 23f5f4d85fff2a427ab1e100c9f0e3477b9c5cac Mon Sep 17 00:00:00 2001 From: Phantom Date: Sun, 21 Dec 2025 16:41:51 +0100 Subject: [PATCH 18/26] Add fix-missing --- .github/workflows/cd.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index 74915c1ef..9b7c5c965 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -88,7 +88,7 @@ jobs: - name: Install dependencies run: | sudo apt-get update - sudo apt-get install -y libx11-dev libxcursor-dev libxinerama-dev build-essential gettext libtool libtool-bin libpulse-dev libasound2-dev libjack-dev portaudio19-dev + sudo apt-get install -y --fix-missing libx11-dev libxcursor-dev libxinerama-dev build-essential gettext libtool libtool-bin libpulse-dev libasound2-dev libjack-dev portaudio19-dev - name: Setup Vulkan uses: ./.github/actions/vulkan - name: Setup .NET @@ -120,7 +120,7 @@ jobs: - name: Install dependencies run: | sudo apt-get update - sudo apt-get install -y libx11-dev libxcursor-dev libxinerama-dev build-essential gettext libtool libtool-bin libpulse-dev libasound2-dev libjack-dev portaudio19-dev + sudo apt-get install -y --fix-missing libx11-dev libxcursor-dev libxinerama-dev build-essential gettext libtool libtool-bin libpulse-dev libasound2-dev libjack-dev portaudio19-dev - name: Setup Vulkan uses: ./.github/actions/vulkan - name: Setup .NET From 4453453d46b47bd3816ae7decd607350e317c2be Mon Sep 17 00:00:00 2001 From: Ari Vuollet Date: Tue, 23 Dec 2025 00:36:57 +0200 Subject: [PATCH 19/26] Fix managed wrapper function parameter handling for `BytesContainer` --- Source/Tools/Flax.Build/Bindings/BindingsGenerator.Cpp.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/Tools/Flax.Build/Bindings/BindingsGenerator.Cpp.cs b/Source/Tools/Flax.Build/Bindings/BindingsGenerator.Cpp.cs index 190036af4..0274ca45b 100644 --- a/Source/Tools/Flax.Build/Bindings/BindingsGenerator.Cpp.cs +++ b/Source/Tools/Flax.Build/Bindings/BindingsGenerator.Cpp.cs @@ -925,7 +925,7 @@ namespace Flax.Build.Bindings // BytesContainer if (typeInfo.Type == "BytesContainer" && typeInfo.GenericArgs == null) - return "MUtils::ToArray({0})"; + return $"MUtils::ToArray({value})"; // Construct native typename for MUtils template argument var nativeType = new StringBuilder(64); From 35f8051a62fbefbdc260e064b3f424089619a028 Mon Sep 17 00:00:00 2001 From: Ari Vuollet Date: Sat, 20 Dec 2025 01:51:37 +0200 Subject: [PATCH 20/26] Fix managed boolean array conversion to native array --- .../Flax.Build/Bindings/BindingsGenerator.Cpp.cs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/Source/Tools/Flax.Build/Bindings/BindingsGenerator.Cpp.cs b/Source/Tools/Flax.Build/Bindings/BindingsGenerator.Cpp.cs index 0274ca45b..9836d1cb6 100644 --- a/Source/Tools/Flax.Build/Bindings/BindingsGenerator.Cpp.cs +++ b/Source/Tools/Flax.Build/Bindings/BindingsGenerator.Cpp.cs @@ -770,6 +770,11 @@ namespace Flax.Build.Bindings genericArgs += ", " + typeInfo.GenericArgs[1]; result = $"Array<{genericArgs}>({result})"; } + else if (arrayApiType?.Name == "bool") + { + type = "bool*"; + result = "Array({0}, {1})"; + } return result; } @@ -1244,8 +1249,12 @@ namespace Flax.Build.Bindings callParams += ", "; separator = true; var name = parameterInfo.Name; + var countParamName = $"__{parameterInfo.Name}Count"; if (CppParamsThatNeedConversion[i] && (!FindApiTypeInfo(buildData, parameterInfo.Type, caller)?.IsStruct ?? false)) + { name = '*' + name; + countParamName = '*' + countParamName; + } string param = string.Empty; if (string.IsNullOrWhiteSpace(CppParamsWrappersCache[i])) @@ -1258,7 +1267,7 @@ namespace Flax.Build.Bindings else { // Convert value - param += string.Format(CppParamsWrappersCache[i], name); + param += string.Format(CppParamsWrappersCache[i], name, countParamName); } // Special case for output result parameters that needs additional converting from native to managed format (such as non-POD structures or output array parameter) From c30d457b1c86f291d3d6e0891686d0fb3f813f86 Mon Sep 17 00:00:00 2001 From: Wojtek Figat Date: Mon, 29 Dec 2025 22:05:01 +0100 Subject: [PATCH 21/26] Add unit test of code from #3858 to ensure stability --- Source/Engine/Tests/TestScripting.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Source/Engine/Tests/TestScripting.h b/Source/Engine/Tests/TestScripting.h index 10a1cf2b8..ca13ac307 100644 --- a/Source/Engine/Tests/TestScripting.h +++ b/Source/Engine/Tests/TestScripting.h @@ -204,6 +204,9 @@ public: { return str.Length(); } + + // Test parameter passing with non-cost ref + API_FUNCTION() virtual void StringParamRef(String& str) {} }; // Test debug commands via static class. From 6f6dd2f4a3328d09061c837a3be428419028db6d Mon Sep 17 00:00:00 2001 From: Wojtek Figat Date: Mon, 29 Dec 2025 22:06:55 +0100 Subject: [PATCH 22/26] Fix crash on script VTable setup due to async #3580 --- Source/Engine/Scripting/BinaryModule.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/Source/Engine/Scripting/BinaryModule.cpp b/Source/Engine/Scripting/BinaryModule.cpp index 07feedf10..3c7ee7a38 100644 --- a/Source/Engine/Scripting/BinaryModule.cpp +++ b/Source/Engine/Scripting/BinaryModule.cpp @@ -477,8 +477,8 @@ void ScriptingType::SetupScriptObjectVTable(void* object, ScriptingTypeHandle ba } // Duplicate vtable - Script.VTable = (void**)((byte*)Platform::Allocate(totalSize, 16) + prefixSize); - Utilities::UnsafeMemoryCopy((byte*)Script.VTable - prefixSize, (byte*)vtable - prefixSize, prefixSize + size); + void** scriptVTable = (void**)((byte*)Platform::Allocate(totalSize, 16) + prefixSize); + Utilities::UnsafeMemoryCopy((byte*)scriptVTable - prefixSize, (byte*)vtable - prefixSize, prefixSize + size); // Override vtable entries if (interfacesCount) @@ -492,7 +492,7 @@ void ScriptingType::SetupScriptObjectVTable(void* object, ScriptingTypeHandle ba if (eType.Script.SetupScriptObjectVTable) { // Override vtable entries for this class - eType.Script.SetupScriptObjectVTable(Script.ScriptVTable, Script.ScriptVTableBase, Script.VTable, entriesCount, wrapperIndex); + eType.Script.SetupScriptObjectVTable(Script.ScriptVTable, Script.ScriptVTableBase, scriptVTable, entriesCount, wrapperIndex); } auto interfaces = eType.Interfaces; @@ -511,13 +511,13 @@ void ScriptingType::SetupScriptObjectVTable(void* object, ScriptingTypeHandle ba const int32 interfaceSize = interfaceCount * sizeof(void*); // Duplicate interface vtable - Utilities::UnsafeMemoryCopy((byte*)Script.VTable + interfaceOffset, (byte*)vtableInterface - prefixSize, prefixSize + interfaceSize); + Utilities::UnsafeMemoryCopy((byte*)scriptVTable + interfaceOffset, (byte*)vtableInterface - prefixSize, prefixSize + interfaceSize); // Override interface vtable entries const auto scriptOffset = interfaces->ScriptVTableOffset; const auto nativeOffset = interfaceOffset + prefixSize; void** interfaceVTable = (void**)((byte*)Script.VTable + nativeOffset); - interfaceType.Interface.SetupScriptObjectVTable(Script.ScriptVTable + scriptOffset, Script.ScriptVTableBase + scriptOffset, interfaceVTable, interfaceCount, wrapperIndex); + interfaceType.Interface.SetupScriptObjectVTable(scriptVTable + scriptOffset, Script.ScriptVTableBase + scriptOffset, interfaceVTable, interfaceCount, wrapperIndex); Script.InterfacesOffsets[interfacesCount++] = (uint16)nativeOffset; interfaceOffset += prefixSize + interfaceSize; @@ -527,6 +527,9 @@ void ScriptingType::SetupScriptObjectVTable(void* object, ScriptingTypeHandle ba } e = eType.GetBaseType(); } + + // Assign once it's ready + Script.VTable = scriptVTable; } void ScriptingType::HackObjectVTable(void* object, ScriptingTypeHandle baseTypeHandle, int32 wrapperIndex) From 1bdb577b60fc1c3fe893e9c2694233ae0a652a06 Mon Sep 17 00:00:00 2001 From: Wojtek Figat Date: Mon, 29 Dec 2025 22:24:55 +0100 Subject: [PATCH 23/26] Fix engine services before exit event order --- Source/Engine/Engine/EngineService.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/Engine/Engine/EngineService.cpp b/Source/Engine/Engine/EngineService.cpp index 433cf089f..240f60a63 100644 --- a/Source/Engine/Engine/EngineService.cpp +++ b/Source/Engine/Engine/EngineService.cpp @@ -26,7 +26,7 @@ static bool CompareEngineServices(EngineService* const& a, EngineService* const& { \ ZoneScoped; \ auto& services = GetServices(); \ - for (int32 i = 0; i < services.Count(); i++) \ + for (int32 i = services.Count() - 1; i >= 0; i--) \ services[i]->name(); \ } From 7cdc2456cd9690ca3d150bb071f1c3ab73ae15fb Mon Sep 17 00:00:00 2001 From: Wojtek Figat Date: Mon, 29 Dec 2025 22:53:37 +0100 Subject: [PATCH 24/26] Clone #3878 into more usages --- .github/workflows/build_linux.yml | 3 ++- .github/workflows/tests.yml | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build_linux.yml b/.github/workflows/build_linux.yml index 6290ff525..760041b6a 100644 --- a/.github/workflows/build_linux.yml +++ b/.github/workflows/build_linux.yml @@ -16,7 +16,8 @@ jobs: uses: actions/checkout@v3 - name: Install dependencies run: | - sudo apt-get install libx11-dev libxcursor-dev libxinerama-dev build-essential gettext libtool libtool-bin libpulse-dev libasound2-dev libjack-dev portaudio19-dev + sudo apt-get update + sudo apt-get install -y --fix-missing libx11-dev libxcursor-dev libxinerama-dev build-essential gettext libtool libtool-bin libpulse-dev libasound2-dev libjack-dev portaudio19-dev - name: Setup Vulkan uses: ./.github/actions/vulkan - name: Setup .NET diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 7c28121fd..fdc8e80c9 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -28,7 +28,8 @@ jobs: git lfs pull - name: Install dependencies run: | - sudo apt-get install libx11-dev libxcursor-dev libxinerama-dev build-essential gettext libtool libtool-bin libpulse-dev libasound2-dev libjack-dev portaudio19-dev + sudo apt-get update + sudo apt-get install -y --fix-missing libx11-dev libxcursor-dev libxinerama-dev build-essential gettext libtool libtool-bin libpulse-dev libasound2-dev libjack-dev portaudio19-dev - name: Build run: | ./GenerateProjectFiles.sh -vs2022 -log -verbose -printSDKs -dotnet=8 From b87f8b96e1c616b4b44ae6d378eead89618d0af9 Mon Sep 17 00:00:00 2001 From: fibref Date: Thu, 1 Jan 2026 17:44:33 +0800 Subject: [PATCH 25/26] fix crash on asset auto-upgrade --- Source/Engine/Content/Factories/BinaryAssetFactory.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Source/Engine/Content/Factories/BinaryAssetFactory.cpp b/Source/Engine/Content/Factories/BinaryAssetFactory.cpp index e9479a107..c492bd5b0 100644 --- a/Source/Engine/Content/Factories/BinaryAssetFactory.cpp +++ b/Source/Engine/Content/Factories/BinaryAssetFactory.cpp @@ -146,6 +146,10 @@ bool BinaryAssetFactoryBase::UpgradeAsset(const AssetInfo& info, FlaxStorage* st context.Input = context.Output; } while (upgrader->ShouldUpgrade(context.Input.SerializedVersion)); + // Prevent other threads from loading the storage when it is upgrading + // It works because CriticalSection allows recursion + ScopeLock upgradeLock(storage->_loadLocker); + // Release storage internal data (should also close file handles) { // HACK: file is locked by some tasks: the current one that called asset data upgrade (LoadAssetTask) From 8facb46defc4de91e2127694a82eefeb6ceb4e53 Mon Sep 17 00:00:00 2001 From: Wojtek Figat Date: Fri, 2 Jan 2026 17:06:27 +0100 Subject: [PATCH 26/26] Fix regression from 6f6dd2f4a3328d09061c837a3be428419028db6d on script interface vtable setup --- Source/Engine/Scripting/BinaryModule.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/Engine/Scripting/BinaryModule.cpp b/Source/Engine/Scripting/BinaryModule.cpp index 3c7ee7a38..4d26e678b 100644 --- a/Source/Engine/Scripting/BinaryModule.cpp +++ b/Source/Engine/Scripting/BinaryModule.cpp @@ -516,7 +516,7 @@ void ScriptingType::SetupScriptObjectVTable(void* object, ScriptingTypeHandle ba // Override interface vtable entries const auto scriptOffset = interfaces->ScriptVTableOffset; const auto nativeOffset = interfaceOffset + prefixSize; - void** interfaceVTable = (void**)((byte*)Script.VTable + nativeOffset); + void** interfaceVTable = (void**)((byte*)scriptVTable + nativeOffset); interfaceType.Interface.SetupScriptObjectVTable(scriptVTable + scriptOffset, Script.ScriptVTableBase + scriptOffset, interfaceVTable, interfaceCount, wrapperIndex); Script.InterfacesOffsets[interfacesCount++] = (uint16)nativeOffset;