56 Commits

Author SHA1 Message Date
6e61233a7b _rider improvement
Some checks failed
Build Android / Game (Android, Release ARM64) (push) Has been cancelled
Build iOS / Game (iOS, Release ARM64) (push) Has been cancelled
Build Linux / Editor (Linux, Development x64) (push) Has been cancelled
Build Linux / Game (Linux, Release x64) (push) Has been cancelled
Build macOS / Editor (Mac, Development ARM64) (push) Has been cancelled
Build macOS / Game (Mac, Release ARM64) (push) Has been cancelled
Build Windows / Editor (Windows, Development x64) (push) Has been cancelled
Build Windows / Game (Windows, Release x64) (push) Has been cancelled
Cooker / Cook (Mac) (push) Has been cancelled
Tests / Tests (Linux) (push) Has been cancelled
Tests / Tests (Windows) (push) Has been cancelled
2025-10-29 23:03:01 +02:00
bf59455412 _zed macos final
Some checks failed
Build Android / Game (Android, Release ARM64) (push) Has been cancelled
Build iOS / Game (iOS, Release ARM64) (push) Has been cancelled
Build Linux / Editor (Linux, Development x64) (push) Has been cancelled
Build Linux / Game (Linux, Release x64) (push) Has been cancelled
Build macOS / Editor (Mac, Development ARM64) (push) Has been cancelled
Build macOS / Game (Mac, Release ARM64) (push) Has been cancelled
Build Windows / Editor (Windows, Development x64) (push) Has been cancelled
Build Windows / Game (Windows, Release x64) (push) Has been cancelled
Cooker / Cook (Mac) (push) Has been cancelled
Tests / Tests (Linux) (push) Has been cancelled
Tests / Tests (Windows) (push) Has been cancelled
2025-10-29 21:13:20 +02:00
a016b9d47b _rider macos
Some checks failed
Build Android / Game (Android, Release ARM64) (push) Has been cancelled
Build iOS / Game (iOS, Release ARM64) (push) Has been cancelled
Build Linux / Editor (Linux, Development x64) (push) Has been cancelled
Build Linux / Game (Linux, Release x64) (push) Has been cancelled
Build macOS / Editor (Mac, Development ARM64) (push) Has been cancelled
Build macOS / Game (Mac, Release ARM64) (push) Has been cancelled
Build Windows / Editor (Windows, Development x64) (push) Has been cancelled
Build Windows / Game (Windows, Release x64) (push) Has been cancelled
Cooker / Cook (Mac) (push) Has been cancelled
Tests / Tests (Linux) (push) Has been cancelled
Tests / Tests (Windows) (push) Has been cancelled
2025-10-29 20:44:34 +02:00
7bdc08f8be _macos? 2025-10-29 20:43:50 +02:00
269e8963e8 Add support for Zed code editor
Some checks failed
Build Android / Game (Android, Release ARM64) (push) Has been cancelled
Build iOS / Game (iOS, Release ARM64) (push) Has been cancelled
Build Linux / Editor (Linux, Development x64) (push) Has been cancelled
Build Linux / Game (Linux, Release x64) (push) Has been cancelled
Build macOS / Editor (Mac, Development ARM64) (push) Has been cancelled
Build macOS / Game (Mac, Release ARM64) (push) Has been cancelled
Build Windows / Editor (Windows, Development x64) (push) Has been cancelled
Build Windows / Game (Windows, Release x64) (push) Has been cancelled
Cooker / Cook (Mac) (push) Has been cancelled
Tests / Tests (Linux) (push) Has been cancelled
Tests / Tests (Windows) (push) Has been cancelled
2025-10-29 20:16:05 +02:00
Wojtek Figat
d24bd7dfd0 Merge branch 'GoaLitiuM-dotnet_define_fix' 2025-10-29 07:40:11 +01:00
2c8c9b1637 Fix .NET version preprocessor definitions 2025-10-29 08:26:39 +02:00
Wojtek Figat
05a8c841da Fix color grading lut to be refreshed when shader gets reloaded 2025-10-28 23:19:51 +01:00
Wojtek Figat
c4fcaa999c Fix asset thumbnails to be stable with FXAA instead of TAA 2025-10-28 22:23:15 +01:00
Wojtek Figat
70c9dd6608 Fix eye adaptation in Manual mode 2025-10-28 21:36:28 +01:00
Wojtek Figat
802e2ac7c2 Fix compiling stb texture tool on Windows 2025-10-28 21:25:30 +01:00
Wojtek Figat
0ca60062d9 Fix crash on leftover physic contact collision processing 2025-10-28 16:17:48 +01:00
Wojtek Figat
22515c37b5 Fix crash regression in D3D12 UAV bindings code 2025-10-27 22:38:47 +01:00
Wojtek Figat
38a48cf1d4 Update build number 2025-10-27 16:48:52 +01:00
Wojtek Figat
cd66d00219 Add checking hardware instruction set on Windows earlier on
#3732
2025-10-27 16:48:24 +01:00
Wojtek Figat
c944bd9bed Fix missing Vulkan feature activation for host query reset 2025-10-27 00:32:29 +01:00
Wojtek Figat
a0689f3f00 Update all Linux deps with Clang 14 on Ubuntu 24 2025-10-27 00:01:36 +01:00
Wojtek Figat
2ee2c97f1e Update docs for Ubuntu 24 and Clang 4 2025-10-26 21:48:49 +01:00
Wojtek Figat
fd19e83a46 Merge branch 'Tryibion-fix-no-undo-for-drag-spawn' 2025-10-25 22:52:47 +02:00
Wojtek Figat
755702b65a Improve #3747 to check for loaded levels in drag drop validation 2025-10-25 22:52:41 +02:00
Wojtek Figat
72e200a7fc Merge branch 'fix-no-undo-for-drag-spawn' of https://github.com/Tryibion/FlaxEngine into Tryibion-fix-no-undo-for-drag-spawn 2025-10-25 22:50:01 +02:00
Wojtek Figat
6353e5f4f2 Merge branch 'Tryibion-fix-arrow-up-tree-select' 2025-10-25 22:47:21 +02:00
Wojtek Figat
b184022d15 Merge branch 'fix-arrow-up-tree-select' of https://github.com/Tryibion/FlaxEngine into Tryibion-fix-arrow-up-tree-select 2025-10-25 22:46:55 +02:00
Wojtek Figat
26dce69404 Merge branch 'GoaLitiuM-dotnet10_sdkver' 2025-10-25 22:45:34 +02:00
2841ac22df Bump the maximum supported .NET SDK version to 10 2025-10-25 22:35:48 +03:00
Wojtek Figat
516f22c3c0 Merge branch 'GoaLitiuM-dotnet_error_messages' 2025-10-25 21:14:23 +02:00
Wojtek Figat
5a8c4cd0a5 Merge branch 'dotnet_error_messages' of https://github.com/GoaLitiuM/FlaxEngine into GoaLitiuM-dotnet_error_messages 2025-10-25 21:14:19 +02:00
Wojtek Figat
f53b7e3323 Merge branch 'Tryibion-fix-default-scale-option' 2025-10-25 21:10:34 +02:00
Chandler Cox
c1439c646e Fix default for prefab canvas size index being 0 instead of -1. 2025-10-25 11:34:48 -05:00
280035e54f Use stderr for Flax.Build error messages
This turns the error messages from Flax.Build to red in Flax Editor
console output.
2025-10-24 23:27:18 +03:00
0d140c4f39 Fix Windows dotnet version lookup without installed SDK
Having only x86 dotnet SDK installed while expecting x64 version fails
prematurely.
2025-10-24 23:27:17 +03:00
32b4efc175 Add missing .NET installation architecture info to error messages 2025-10-24 23:27:17 +03:00
Wojtek Figat
d1774cac28 Go back to SSE4.2 on Windows as minimum requirement instead of AVX2 for better user coverage by default
#3732
2025-10-22 16:14:05 +02:00
Wojtek Figat
2629511224 Merge branch 'Tryibion-fix-duplicate-collection-option' 2025-10-20 22:04:12 +02:00
Wojtek Figat
bcf7226946 Merge branch 'fix-duplicate-collection-option' of https://github.com/Tryibion/FlaxEngine into Tryibion-fix-duplicate-collection-option 2025-10-20 22:04:05 +02:00
Wojtek Figat
f5c9e00beb Merge branch 'GoaLitiuM-woa_alignment' 2025-10-20 22:03:39 +02:00
Wojtek Figat
6353514188 Merge branch 'woa_alignment' of https://github.com/GoaLitiuM/FlaxEngine into GoaLitiuM-woa_alignment 2025-10-20 22:03:32 +02:00
Wojtek Figat
8467315a1e Fix motion vector stability on Large World origin changes
#3745
2025-10-20 18:08:54 +02:00
Chandler Cox
be5dbbb95f Fix duplicate option for collections being grayed out if nothing is in clipboard. 2025-10-19 15:55:57 -05:00
6b9c727a6a Fix compiler warning 2025-10-19 22:16:34 +03:00
91c0ba1986 Enforce pointer alignment for InlinedAllocation
AssetReferences stored in inlined allocation needs to be aligned to
pointer sized boundary due to atomic operations having strict
requirements for such. Unaligned access seems to only crash on
Windows on ARM systems when trying to allocate TextRender draw chunks.
2025-10-19 22:14:28 +03:00
Chandler Cox
e4bb8001b2 Fix not having undo for items dragged into scene tree into empty space. 2025-10-18 18:23:33 -05:00
Wojtek Figat
d93c32db9c Merge remote-tracking branch 'origin/1.11'
# Conflicts:
#	Source/Tools/Flax.Build/Deps/Downloader.cs
2025-10-16 14:07:49 +02:00
Wojtek Figat
08abdc159e Another ios build change to use dotnet 9 instead 2025-10-16 13:38:26 +02:00
Wojtek Figat
708b9c6767 Attempt to fix missing ios workload for .NET 8 2025-10-16 12:12:37 +02:00
Wojtek Figat
ed26a4c182 Fix moving character controller when displacement is zero 2025-10-16 11:34:43 +02:00
Wojtek Figat
a239984908 Add console logging for VSCode on Mac and Linux inside game projects 2025-10-16 10:47:41 +02:00
Wojtek Figat
fc3ea44c69 Update OpenAL on Mac/iOS 2025-10-16 10:40:08 +02:00
Wojtek Figat
fdecad0d29 Fix Vulkan crash on missing handle owner during binding 2025-10-16 10:39:50 +02:00
Wojtek Figat
c7437ed533 Fix OpenAL Soft building due to missing certs on a website 2025-10-16 10:39:36 +02:00
Wojtek Figat
dab44f5ceb Minor fixes 2025-10-16 10:20:51 +02:00
Wojtek Figat
c635d93b3c Fix more errors in Visject context menu regressions 2025-10-15 14:44:58 +02:00
Wojtek Figat
09fa3ce4be Minor changes 2025-10-14 15:07:40 +02:00
Chandler Cox
bd0daf7580 Fix tree arrowing up not selecting children in tree. 2025-10-13 21:49:05 -05:00
Wojtek Figat
e1b3429b4c Fix regression on game window defocus 2025-10-13 21:50:19 +02:00
Wojtek Figat
efa963be68 Fix editor error when prefab asset is unloaded 2025-10-13 21:45:31 +02:00
87 changed files with 557 additions and 204 deletions

View File

@@ -19,7 +19,7 @@ jobs:
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 8.0.x
dotnet-version: 9.0.x
- name: Setup .NET Workload
run: |
dotnet workload install ios
@@ -33,4 +33,4 @@ jobs:
git lfs pull
- name: Build
run: |
./Development/Scripts/Mac/CallBuildTool.sh -build -log -dotnet=8 -arch=ARM64 -platform=iOS -configuration=Release -buildtargets=FlaxGame
./Development/Scripts/Mac/CallBuildTool.sh -build -log -dotnet=9 -arch=ARM64 -platform=iOS -configuration=Release -buildtargets=FlaxGame

BIN
Content/Shaders/ColorGrading.flax (Stored with Git LFS)

Binary file not shown.

BIN
Content/Shaders/MotionBlur.flax (Stored with Git LFS)

Binary file not shown.

View File

@@ -4,7 +4,7 @@
"Major": 1,
"Minor": 11,
"Revision": 0,
"Build": 6801
"Build": 6802
},
"Company": "Flax",
"Copyright": "Copyright (c) 2012-2025 Wojciech Figat. All rights reserved.",

View File

@@ -49,7 +49,7 @@ Follow the instructions below to compile and run the engine from source.
* Fedora: `sudo dnf install dotnet-sdk-8.0`
* Arch: `sudo pacman -S dotnet-sdk-8.0 dotnet-runtime-8.0 dotnet-targeting-pack-8.0 dotnet-host`
* Install Vulkan SDK ([https://vulkan.lunarg.com/](https://vulkan.lunarg.com/))
* Ubuntu: `sudo apt install vulkan-sdk`
* Ubuntu: `sudo apt install vulkan-sdk` (deprecated, follow official docs)
* Fedora: `sudo dnf install vulkan-headers vulkan-tools vulkan-validation-layers`
* Arch: `sudo pacman -S vulkan-headers vulkan-tools vulkan-validation-layers`
* Install Git with LFS
@@ -60,7 +60,7 @@ Follow the instructions below to compile and run the engine from source.
* Ubuntu: `sudo apt-get install libx11-dev libxcursor-dev libxinerama-dev zlib1g-dev`
* Fedora: `sudo dnf install libX11-devel libXcursor-devel libXinerama-devel ghc-zlib-devel`
* Arch: `sudo pacman -S base-devel libx11 libxcursor libxinerama zlib`
* Install Clang compiler (version 6 or later):
* Install Clang compiler (version 14 or later):
* Ubuntu: `sudo apt-get install clang lldb lld`
* Fedora: `sudo dnf install clang llvm lldb lld`
* Arch: `sudo pacman -S clang lldb lld`

View File

@@ -130,6 +130,11 @@ namespace FlaxEditor.Content
eyeAdaptation.Mode = EyeAdaptationMode.None;
eyeAdaptation.OverrideFlags |= EyeAdaptationSettingsOverride.Mode;
preview.PostFxVolume.EyeAdaptation = eyeAdaptation;
var antiAliasing = preview.PostFxVolume.AntiAliasing;
antiAliasing.Mode = AntialiasingMode.FastApproximateAntialiasing;
antiAliasing.OverrideFlags |= AntiAliasingSettingsOverride.Mode;
preview.PostFxVolume.AntiAliasing = antiAliasing;
}
}
}

View File

@@ -71,7 +71,7 @@ namespace FlaxEditor.CustomEditors.Editors
menu.AddButton("Copy", linkedEditor.Copy);
var b = menu.AddButton("Duplicate", () => Editor.Duplicate(Index));
b.Enabled = linkedEditor.CanPaste && !Editor._readOnly && Editor._canResize;
b.Enabled = !Editor._readOnly && Editor._canResize;
b = menu.AddButton("Paste", linkedEditor.Paste);
b.Enabled = linkedEditor.CanPaste && !Editor._readOnly;
@@ -407,7 +407,7 @@ namespace FlaxEditor.CustomEditors.Editors
menu.AddButton("Copy", linkedEditor.Copy);
var b = menu.AddButton("Duplicate", () => Editor.Duplicate(Index));
b.Enabled = linkedEditor.CanPaste && !Editor._readOnly && Editor._canResize;
b.Enabled = !Editor._readOnly && Editor._canResize;
var paste = menu.AddButton("Paste", linkedEditor.Paste);
paste.Enabled = linkedEditor.CanPaste && !Editor._readOnly;

View File

@@ -447,8 +447,8 @@ namespace FlaxEditor.GUI.Tree
// Select previous parent child
var select = nodeParent.GetChild(myIndex - 1) as TreeNode;
// Select last child if is valid and expanded and has any children
if (select != null && select.IsExpanded && select.HasAnyVisibleChild)
// Get bottom most child node
while (select != null && select.IsExpanded && select.HasAnyVisibleChild)
{
select = select.GetChild(select.ChildrenCount - 1) as TreeNode;
}

View File

@@ -40,10 +40,11 @@ namespace FlaxEditor.Modules.SourceCodeEditing
var codeEditing = Editor.Instance.CodeEditing;
var vsCode = codeEditing.GetInBuildEditor(CodeEditorTypes.VSCode);
var rider = codeEditing.GetInBuildEditor(CodeEditorTypes.Rider);
var zed = codeEditing.GetInBuildEditor(CodeEditorTypes.Zed);
#if PLATFORM_WINDOW
// Favor the newest Visual Studio
for (int i = (int)CodeEditorTypes.VS2019; i >= (int)CodeEditorTypes.VS2008; i--)
for (int i = (int)CodeEditorTypes.VS2026; i >= (int)CodeEditorTypes.VS2008; i--)
{
var visualStudio = codeEditing.GetInBuildEditor((CodeEditorTypes)i);
if (visualStudio != null)
@@ -66,6 +67,8 @@ namespace FlaxEditor.Modules.SourceCodeEditing
_currentEditor = vsCode;
else if (rider != null)
_currentEditor = rider;
else if (zed != null)
_currentEditor = zed;
else
_currentEditor = codeEditing.GetInBuildEditor(CodeEditorTypes.SystemDefault);
}

View File

@@ -66,6 +66,9 @@ namespace FlaxEditor.Modules.SourceCodeEditing
case CodeEditorTypes.Rider:
Name = "Rider";
break;
case CodeEditorTypes.Zed:
Name = "Zed";
break;
default: throw new ArgumentOutOfRangeException(nameof(type), type, null);
}
}
@@ -83,6 +86,7 @@ namespace FlaxEditor.Modules.SourceCodeEditing
case CodeEditorTypes.VSCodeInsiders:
case CodeEditorTypes.VSCode: return "-vscode -vs2022";
case CodeEditorTypes.Rider: return "-vs2022";
case CodeEditorTypes.Zed: return "-vs2022";
default: return null;
}
}

View File

@@ -6,6 +6,7 @@
#include "ScriptsBuilder.h"
#include "CodeEditors/VisualStudioCodeEditor.h"
#include "CodeEditors/RiderCodeEditor.h"
#include "CodeEditors/ZedEditor.h"
#if USE_VISUAL_STUDIO_DTE
#include "CodeEditors/VisualStudio/VisualStudioEditor.h"
#endif
@@ -241,6 +242,7 @@ bool CodeEditingManagerService::Init()
#endif
VisualStudioCodeEditor::FindEditors(&CodeEditors);
RiderCodeEditor::FindEditors(&CodeEditors);
ZedEditor::FindEditors(&CodeEditors);
CodeEditors.Add(New<SystemDefaultCodeEditor>());
return false;

View File

@@ -77,6 +77,11 @@ API_ENUM(Namespace="FlaxEditor", Attributes="HideInEditor") enum class CodeEdito
/// </summary>
VSCodeInsiders,
/// <summary>
/// Zed
/// </summary>
Zed,
/// <summary>
/// Rider
/// </summary>

View File

@@ -14,6 +14,9 @@
#if PLATFORM_WINDOWS
#include "Engine/Platform/Win32/IncludeWindowsHeaders.h"
#elif PLATFORM_MAC
#include "Engine/Platform/Apple/AppleUtils.h"
#include <AppKit/AppKit.h>
#endif
namespace
@@ -218,6 +221,15 @@ void RiderCodeEditor::FindEditors(Array<CodeEditor*>* output)
#endif
#if PLATFORM_MAC
// System installed app
NSURL* AppURL = [[NSWorkspace sharedWorkspace]URLForApplicationWithBundleIdentifier:@"com.jetbrains.rider"];
if (AppURL != nullptr)
{
const String path = AppleUtils::ToString((CFStringRef)[AppURL path]);
SearchDirectory(&installations, path / TEXT("/Contents/Resources"));
}
// JetBrains Toolbox installations
String applicationSupportFolder;
FileSystem::GetSpecialFolderPath(SpecialFolder::ProgramData, applicationSupportFolder);
@@ -232,6 +244,7 @@ void RiderCodeEditor::FindEditors(Array<CodeEditor*>* output)
// Check the local installer version
SearchDirectory(&installations, TEXT("/Applications/Rider.app/Contents/Resources"));
SearchDirectory(&installations, TEXT("/Applications/Rider EAP.app/Contents/Resources"));
#endif
for (const String& directory : subDirectories)

View File

@@ -0,0 +1,180 @@
// Copyright (c) Wojciech Figat. All rights reserved.
#include "ZedEditor.h"
#include "Engine/Platform/FileSystem.h"
#include "Engine/Platform/CreateProcessSettings.h"
#include "Engine/Core/Log.h"
#include "Editor/Editor.h"
#include "Editor/ProjectInfo.h"
#include "Editor/Scripting/ScriptsBuilder.h"
#include "Engine/Engine/Globals.h"
#if PLATFORM_LINUX
#include <stdio.h>
#elif PLATFORM_WINDOWS
#include "Engine/Platform/Win32/IncludeWindowsHeaders.h"
#elif PLATFORM_MAC
#include "Engine/Platform/Apple/AppleUtils.h"
#include <AppKit/AppKit.h>
#endif
ZedEditor::ZedEditor(const String& execPath)
: _execPath(execPath)
, _workspacePath(Globals::ProjectFolder)
{
}
void ZedEditor::FindEditors(Array<CodeEditor*>* output)
{
#if PLATFORM_WINDOWS
String cmd;
if (Platform::ReadRegValue(HKEY_CURRENT_USER, TEXT("SOFTWARE\\Classes\\Applications\\Zed.exe\\shell\\open\\command"), TEXT(""), &cmd) || cmd.IsEmpty())
{
if (Platform::ReadRegValue(HKEY_LOCAL_MACHINE, TEXT("SOFTWARE\\Classes\\Applications\\Zed.exe\\shell\\open\\command"), TEXT(""), &cmd) || cmd.IsEmpty())
{
// No hits in registry, try default path instead
}
}
String path;
if (cmd.IsEmpty())
{
path = cmd.Substring(1, cmd.Length() - String(TEXT("\" \"%1\"")).Length() - 1);
}
else
{
String localAppDataPath;
FileSystem::GetSpecialFolderPath(SpecialFolder::LocalAppData, localAppDataPath);
path = localAppDataPath / TEXT("Programs/Zed/Zed.exe");
}
if (FileSystem::FileExists(path))
{
output->Add(New<ZedEditor>(path));
}
#elif PLATFORM_LINUX
char buffer[128];
FILE* pipe = popen("/bin/bash -c \"type -p zed\"", "r");
if (pipe)
{
StringAnsi pathAnsi;
while (fgets(buffer, sizeof(buffer), pipe) != NULL)
pathAnsi += buffer;
pclose(pipe);
const String path(pathAnsi.Get(), pathAnsi.Length() != 0 ? pathAnsi.Length() - 1 : 0);
if (FileSystem::FileExists(path))
{
output->Add(New<VisualStudioCodeEditor>(path, false));
return;
}
}
{
const String path(TEXT("/usr/bin/zed"));
if (FileSystem::FileExists(path))
{
output->Add(New<VisualStudioCodeEditor>(path, false));
return;
}
}
// Detect Flatpak installations
{
CreateProcessSettings procSettings;
procSettings.FileName = TEXT("/bin/bash -c \"flatpak list --app --columns=application | grep dev.zed.Zed -c\"");
procSettings.HiddenWindow = true;
if (Platform::CreateProcess(procSettings) == 0)
{
const String runPath(TEXT("flatpak run dev.zed.Zed"));
output->Add(New<VisualStudioCodeEditor>(runPath));
return;
}
}
#elif PLATFORM_MAC
// Prefer the Zed CLI application over bundled app, as this handles opening files in existing instance better.
// The bundle also contains the CLI application under Zed.app/Contents/MacOS/zed, but using this doesn't make any difference.
const String cliPath(TEXT("/usr/local/bin/zed"));
if (FileSystem::FileExists(cliPath))
{
output->Add(New<ZedEditor>(cliPath));
return;;
}
// System installed app
NSURL* AppURL = [[NSWorkspace sharedWorkspace]URLForApplicationWithBundleIdentifier:@"dev.zed.Zed"];
if (AppURL != nullptr)
{
const String path = AppleUtils::ToString((CFStringRef)[AppURL path]);
output->Add(New<ZedEditor>(path));
return;
}
// Predefined locations
String userFolder;
FileSystem::GetSpecialFolderPath(SpecialFolder::Documents, userFolder);
String paths[3] =
{
TEXT("/Applications/Zed.app"),
userFolder + TEXT("/../Zed.app"),
userFolder + TEXT("/../Downloads/Zed.app"),
};
for (const String& path : paths)
{
if (FileSystem::DirectoryExists(path))
{
output->Add(New<ZedEditor>(path));
break;
}
}
#endif
}
CodeEditorTypes ZedEditor::GetType() const
{
return CodeEditorTypes::Zed;
}
String ZedEditor::GetName() const
{
return TEXT("Zed");
}
void ZedEditor::OpenFile(const String& path, int32 line)
{
// Generate VS solution files for intellisense
if (!FileSystem::FileExists(Globals::ProjectFolder / Editor::Project->Name + TEXT(".sln")))
{
ScriptsBuilder::GenerateProject(TEXT("-vs2022"));
}
// Open file
line = line > 0 ? line : 1;
CreateProcessSettings procSettings;
procSettings.FileName = _execPath;
procSettings.Arguments = String::Format(TEXT("\"{0}\" \"{1}:{2}\""), _workspacePath, path, line);
procSettings.HiddenWindow = false;
procSettings.WaitForEnd = false;
procSettings.LogOutput = false;
procSettings.ShellExecute = true;
Platform::CreateProcess(procSettings);
}
void ZedEditor::OpenSolution()
{
// Generate VS solution files for intellisense
if (!FileSystem::FileExists(Globals::ProjectFolder / Editor::Project->Name + TEXT(".sln")))
{
ScriptsBuilder::GenerateProject(TEXT("-vs2022"));
}
// Open solution
CreateProcessSettings procSettings;
procSettings.FileName = _execPath;
procSettings.Arguments = String::Format(TEXT("\"{0}\""), _workspacePath);
procSettings.HiddenWindow = false;
procSettings.WaitForEnd = false;
procSettings.LogOutput = false;
procSettings.ShellExecute = true;
Platform::CreateProcess(procSettings);
}
bool ZedEditor::UseAsyncForOpen() const
{
return false;
}

View File

@@ -0,0 +1,41 @@
// Copyright (c) Wojciech Figat. All rights reserved.
#pragma once
#include "Editor/Scripting/CodeEditor.h"
/// <summary>
/// Implementation of code editor utility that is using Microsoft Visual Studio Code.
/// </summary>
class ZedEditor : public CodeEditor
{
private:
String _execPath;
String _workspacePath;
public:
/// <summary>
/// Initializes a new instance of the <see cref="VisualStudioEditor"/> class.
/// </summary>
/// <param name="execPath">Executable file path</param>
ZedEditor(const String& execPath);
public:
/// <summary>
/// Tries to find installed Visual Studio Code instance. Adds them to the result list.
/// </summary>
/// <param name="output">The output editors.</param>
static void FindEditors(Array<CodeEditor*>* output);
public:
// [CodeEditor]
CodeEditorTypes GetType() const override;
String GetName() const override;
void OpenFile(const String& path, int32 line) override;
void OpenSolution() override;
bool UseAsyncForOpen() const override;
};

View File

@@ -412,7 +412,7 @@ namespace FlaxEditor.Surface.ContextMenu
{
group.UnlockChildrenRecursive();
// TODO: Improve filtering to be based on boxes with the most common things instead of first box
if (_contextSensitiveSearchEnabled && _selectedBoxes[0] != null)
if (_contextSensitiveSearchEnabled && _selectedBoxes.Count > 0 && _selectedBoxes[0] != null)
UpdateFilters();
else
SortGroups();
@@ -424,7 +424,7 @@ namespace FlaxEditor.Surface.ContextMenu
OnSearchFilterChanged();
}
}
else if (_contextSensitiveSearchEnabled)
else if (_contextSensitiveSearchEnabled && _selectedBoxes.Count > 0)
{
// TODO: Filtering could be improved here as well
group.EvaluateVisibilityWithBox(_selectedBoxes[0]);
@@ -462,7 +462,7 @@ namespace FlaxEditor.Surface.ContextMenu
Parent = group
};
}
if (_contextSensitiveSearchEnabled)
if (_contextSensitiveSearchEnabled && _selectedBoxes.Count > 0)
group.EvaluateVisibilityWithBox(_selectedBoxes[0]);
group.SortChildren();
if (ShowExpanded)
@@ -476,7 +476,7 @@ namespace FlaxEditor.Surface.ContextMenu
if (!isLayoutLocked)
{
if (_contextSensitiveSearchEnabled && _selectedBoxes[0] != null)
if (_contextSensitiveSearchEnabled && _selectedBoxes.Count != 0 && _selectedBoxes[0] != null)
UpdateFilters();
else
SortGroups();

View File

@@ -74,7 +74,7 @@ namespace FlaxEditor.Viewport
private PrefabUIEditorRoot _uiRoot;
private bool _showUI = false;
private int _defaultScaleActiveIndex = 0;
private int _defaultScaleActiveIndex = -1;
private int _customScaleActiveIndex = -1;
private ContextMenuButton _uiModeButton;
private ContextMenuChildMenu _uiViewOptions;
@@ -257,16 +257,23 @@ namespace FlaxEditor.Viewport
/// </summary>
public void SaveActiveUIScalingOption()
{
var defaultKey = $"{Prefab.ID}:DefaultViewportScalingIndex";
if (!Prefab)
return;
var id = Prefab.ID;
var defaultKey = $"{id}:DefaultViewportScalingIndex";
Editor.Instance.ProjectCache.SetCustomData(defaultKey, _defaultScaleActiveIndex.ToString());
var customKey = $"{Prefab.ID}:CustomViewportScalingIndex";
var customKey = $"{id}:CustomViewportScalingIndex";
Editor.Instance.ProjectCache.SetCustomData(customKey, _customScaleActiveIndex.ToString());
}
private void LoadCustomUIScalingOption()
{
if (!Prefab)
return;
var id = Prefab.ID;
Prefab.WaitForLoaded();
var defaultKey = $"{Prefab.ID}:DefaultViewportScalingIndex";
var defaultKey = $"{id}:DefaultViewportScalingIndex";
if (Editor.Instance.ProjectCache.TryGetCustomData(defaultKey, out string defaultData))
{
if (int.TryParse(defaultData, out var index))
@@ -286,7 +293,7 @@ namespace FlaxEditor.Viewport
}
}
var customKey = $"{Prefab.ID}:CustomViewportScalingIndex";
var customKey = $"{id}:CustomViewportScalingIndex";
if (Editor.Instance.ProjectCache.TryGetCustomData(customKey, out string data))
{
if (int.TryParse(data, out var index))

View File

@@ -885,12 +885,12 @@ namespace FlaxEditor.Windows
// Restore cursor visibility (could be hidden by the game)
if (!_cursorVisible)
Screen.CursorVisible = true;
}
if (Editor.IsPlayMode && IsDocked && IsSelected && RootWindow.FocusedControl == null)
{
// Game UI cleared focus so regain it to maintain UI navigation just like game window does
FlaxEngine.Scripting.InvokeOnUpdate(Focus);
if (Editor.IsPlayMode && IsDocked && IsSelected && RootWindow.FocusedControl == null)
{
// Game UI cleared focus so regain it to maintain UI navigation just like game window does
FlaxEngine.Scripting.InvokeOnUpdate(Focus);
}
}
}

View File

@@ -319,22 +319,22 @@ namespace FlaxEditor.Windows
{
if (assetItem.IsOfType<SceneAsset>())
return true;
return assetItem.OnEditorDrag(this);
return assetItem.OnEditorDrag(this) && Level.IsAnySceneLoaded;
}
private static bool ValidateDragActorType(ScriptType actorType)
{
return Editor.Instance.CodeEditing.Actors.Get().Contains(actorType);
return Editor.Instance.CodeEditing.Actors.Get().Contains(actorType) && Level.IsAnySceneLoaded;
}
private static bool ValidateDragControlType(ScriptType controlType)
{
return Editor.Instance.CodeEditing.Controls.Get().Contains(controlType);
return Editor.Instance.CodeEditing.Controls.Get().Contains(controlType) && Level.IsAnySceneLoaded;
}
private static bool ValidateDragScriptItem(ScriptItem script)
{
return Editor.Instance.CodeEditing.Actors.Get(script) != ScriptType.Null;
return Editor.Instance.CodeEditing.Actors.Get(script) != ScriptType.Null && Level.IsAnySceneLoaded;
}
/// <inheritdoc />
@@ -490,6 +490,7 @@ namespace FlaxEditor.Windows
if (result == DragDropEffect.None)
{
_isDropping = true;
// Drag assets
if (_dragAssets != null && _dragAssets.HasValidDrag)
{
@@ -504,7 +505,7 @@ namespace FlaxEditor.Windows
}
var actor = item.OnEditorDrop(this);
actor.Name = item.ShortName;
Level.SpawnActor(actor);
Editor.SceneEditing.Spawn(actor);
var graphNode = Editor.Scene.GetActorNode(actor.ID);
if (graphNode != null)
graphNodes.Add(graphNode);
@@ -527,7 +528,7 @@ namespace FlaxEditor.Windows
continue;
}
actor.Name = item.Name;
Level.SpawnActor(actor);
Editor.SceneEditing.Spawn(actor);
Editor.Scene.MarkSceneEdited(actor.Scene);
}
result = DragDropEffect.Move;
@@ -549,7 +550,7 @@ namespace FlaxEditor.Windows
Control = control,
Name = item.Name,
};
Level.SpawnActor(uiControl);
Editor.SceneEditing.Spawn(uiControl);
Editor.Scene.MarkSceneEdited(uiControl.Scene);
}
result = DragDropEffect.Move;
@@ -571,7 +572,7 @@ namespace FlaxEditor.Windows
continue;
}
actor.Name = actorType.Name;
Level.SpawnActor(actor);
Editor.SceneEditing.Spawn(actor);
var graphNode = Editor.Scene.GetActorNode(actor.ID);
if (graphNode != null)
graphNodes.Add(graphNode);

View File

@@ -208,7 +208,7 @@ public:
typedef typename FallbackAllocation::template Data<T> FallbackData;
bool _useFallback = false;
byte _data[Capacity * sizeof(T)];
alignas(sizeof(void*)) byte _data[Capacity * sizeof(T)];
FallbackData _fallback;
public:

View File

@@ -491,7 +491,7 @@ void GPUContextDX12::flushUAVs()
ASSERT(uaCount <= GPU_MAX_UA_BINDED);
// Fill table with source descriptors
DxShaderHeader& header = _currentCompute ? ((GPUShaderProgramCSDX12*)_currentCompute)->Header : _currentState->Header;
DxShaderHeader& header = _isCompute ? ((GPUShaderProgramCSDX12*)_currentCompute)->Header : _currentState->Header;
D3D12_CPU_DESCRIPTOR_HANDLE srcDescriptorRangeStarts[GPU_MAX_UA_BINDED];
for (uint32 i = 0; i < uaCount; i++)
{

View File

@@ -114,7 +114,7 @@ GPUContextVulkan::GPUContextVulkan(GPUDeviceVulkan* device, QueueVulkan* queue)
#if GPU_ENABLE_TRACY
#if VK_EXT_calibrated_timestamps && VK_EXT_host_query_reset && !PLATFORM_SWITCH
// Use calibrated timestamps extension
if (vkResetQueryPoolEXT && vkGetCalibratedTimestampsEXT)
if (vkResetQueryPoolEXT && vkGetCalibratedTimestampsEXT && _device->PhysicalDeviceFeatures12.hostQueryReset)
{
_tracyContext = tracy::CreateVkContext(_device->Adapter->Gpu, _device->Device, vkResetQueryPoolEXT, vkGetPhysicalDeviceCalibrateableTimeDomainsEXT, vkGetCalibratedTimestampsEXT);
}
@@ -192,6 +192,7 @@ void GPUContextVulkan::AddImageBarrier(VkImage image, VkImageLayout srcLayout, V
void GPUContextVulkan::AddImageBarrier(GPUTextureViewVulkan* handle, VkImageLayout dstLayout)
{
ASSERT(handle->Owner);
auto& state = handle->Owner->State;
const auto subresourceIndex = handle->SubresourceIndex;
if (subresourceIndex == -1)
@@ -516,7 +517,7 @@ void GPUContextVulkan::UpdateDescriptorSets(const SpirvShaderDescriptorInfo& des
case VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE:
{
auto handle = (GPUTextureViewVulkan*)handles[slot];
if (!handle)
if (!handle || !handle->Owner)
{
const auto dummy = _device->HelperResources.GetDummyTexture(descriptor.ResourceType);
switch (descriptor.ResourceType)

View File

@@ -1568,7 +1568,15 @@ bool GPUDeviceVulkan::Init()
vkGetPhysicalDeviceQueueFamilyProperties(gpu, &queueCount, QueueFamilyProps.Get());
// Query device features
RenderToolsVulkan::ZeroStruct(PhysicalDeviceFeatures12, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_2_FEATURES);
vkGetPhysicalDeviceFeatures(gpu, &PhysicalDeviceFeatures);
if (vkGetPhysicalDeviceFeatures2)
{
VkPhysicalDeviceFeatures2 features2;
RenderToolsVulkan::ZeroStruct(features2, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2);
features2.pNext = &PhysicalDeviceFeatures12;
vkGetPhysicalDeviceFeatures2(gpu, &features2);
}
// Get extensions and layers
Array<const char*> deviceExtensions;
@@ -1671,6 +1679,16 @@ bool GPUDeviceVulkan::Init()
VulkanPlatform::RestrictEnabledPhysicalDeviceFeatures(PhysicalDeviceFeatures, enabledFeatures);
deviceInfo.pEnabledFeatures = &enabledFeatures;
#if GPU_ENABLE_TRACY && VK_EXT_calibrated_timestamps && VK_EXT_host_query_reset
VkPhysicalDeviceHostQueryResetFeatures resetFeatures;
if (PhysicalDeviceFeatures12.hostQueryReset)
{
RenderToolsVulkan::ZeroStruct(resetFeatures, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_HOST_QUERY_RESET_FEATURES);
resetFeatures.hostQueryReset = VK_TRUE;
deviceInfo.pNext = &resetFeatures;
}
#endif
// Create the device
VALIDATE_VULKAN_RESULT(vkCreateDevice(gpu, &deviceInfo, nullptr, &Device));

View File

@@ -496,6 +496,7 @@ public:
/// The physical device enabled features.
/// </summary>
VkPhysicalDeviceFeatures PhysicalDeviceFeatures;
VkPhysicalDeviceVulkan12Features PhysicalDeviceFeatures12;
Array<BufferedQueryPoolVulkan*> TimestampQueryPools;
Array<BufferedQueryPoolVulkan*> OcclusionQueryPools;

View File

@@ -5,6 +5,7 @@
#include "Engine/Physics/Physics.h"
#include "Engine/Physics/PhysicsBackend.h"
#include "Engine/Physics/PhysicsScene.h"
#include "Engine/Profiler/ProfilerCPU.h"
#include "Engine/Engine/Time.h"
#define CC_MIN_SIZE 0.001f
@@ -178,6 +179,7 @@ CharacterController::CollisionFlags CharacterController::SimpleMove(const Vector
CharacterController::CollisionFlags CharacterController::Move(const Vector3& displacement)
{
PROFILE_CPU();
CollisionFlags result = CollisionFlags::None;
if (_controller && !_isUpdatingTransform)
{
@@ -377,7 +379,10 @@ void CharacterController::AddMovement(const Vector3& translation, const Quaterni
displacement += GetPhysicsScene()->GetGravity() * deltaTime;
}
Move(displacement);
if (!displacement.IsZero())
{
Move(displacement);
}
if (!rotation.IsIdentity())
{

View File

@@ -1969,6 +1969,7 @@ void PhysicsBackend::EndSimulateScene(void* scene)
scenePhysX->EventsCallback.SendTriggerEvents();
scenePhysX->EventsCallback.SendCollisionEvents();
scenePhysX->EventsCallback.SendJointEvents();
scenePhysX->EventsCallback.Clear();
}
// Clear delta after simulation ended
@@ -4466,14 +4467,14 @@ void PhysicsBackend::FlushRequests(void* scene)
}
if (scenePhysX->RemoveColliders.HasItems())
{
for (int32 i = 0; i < scenePhysX->RemoveColliders.Count(); i++)
scenePhysX->EventsCallback.OnColliderRemoved(scenePhysX->RemoveColliders[i]);
for (PhysicsColliderActor* e : scenePhysX->RemoveColliders)
scenePhysX->EventsCallback.OnColliderRemoved(e);
scenePhysX->RemoveColliders.Clear();
}
if (scenePhysX->RemoveJoints.HasItems())
{
for (int32 i = 0; i < scenePhysX->RemoveJoints.Count(); i++)
scenePhysX->EventsCallback.OnJointRemoved(scenePhysX->RemoveJoints[i]);
for (Joint* e : scenePhysX->RemoveJoints)
scenePhysX->EventsCallback.OnJointRemoved(e);
scenePhysX->RemoveJoints.Clear();
}

View File

@@ -543,11 +543,9 @@ void WindowsPlatform::ReleaseMutex()
}
}
void WindowsPlatform::PreInit(void* hInstance)
PRAGMA_DISABLE_OPTIMIZATION;
void CheckInstructionSet()
{
ASSERT(hInstance);
Instance = hInstance;
#if PLATFORM_ARCH_X86 || PLATFORM_ARCH_X64
// Check the minimum vector instruction set support
int32 cpuInfo[4] = { -1 };
@@ -597,10 +595,19 @@ void WindowsPlatform::PreInit(void* hInstance)
{
// Not supported CPU
CPUBrand cpu;
Error(String::Format(TEXT("Cannot start program due to lack of CPU feature {}.\n\n{}"), missingFeature, String(cpu.Buffer)));
Platform::Error(String::Format(TEXT("Cannot start program due to lack of CPU feature {}.\n\n{}"), missingFeature, String(cpu.Buffer)));
exit(-1);
}
#endif
}
PRAGMA_ENABLE_OPTIMIZATION;
void WindowsPlatform::PreInit(void* hInstance)
{
ASSERT(hInstance);
Instance = hInstance;
CheckInstructionSet();
// Disable the process from being showing "ghosted" while not responding messages during slow tasks
DisableProcessWindowsGhosting();

View File

@@ -47,6 +47,9 @@ public:
Data CachedData;
ToneMappingMode Mode = ToneMappingMode::None;
Texture* LutTexture = nullptr;
#if COMPILE_WITH_DEV_ENV
uint64 FrameRendered = 0;
#endif
~ColorGradingCustomBuffer()
{
@@ -54,6 +57,17 @@ public:
}
};
#if COMPILE_WITH_DEV_ENV
void ColorGradingPass::OnShaderReloading(Asset* obj)
{
_psLut.Release();
invalidateResources();
_reloadedFrame = Engine::FrameCount;
}
#endif
String ColorGradingPass::ToString() const
{
return TEXT("ColorGradingPass");
@@ -194,6 +208,9 @@ GPUTexture* ColorGradingPass::RenderLUT(RenderContext& renderContext)
// Check if LUT parameter hasn't been changed since the last time
if (Platform::MemoryCompare(&colorGradingBuffer.CachedData , &data, sizeof(Data)) == 0 &&
colorGradingBuffer.Mode == toneMapping.Mode &&
#if COMPILE_WITH_DEV_ENV
colorGradingBuffer.FrameRendered > _reloadedFrame &&
#endif
Engine::FrameCount > 30 && // Skip caching when engine is starting TODO: find why this hack is needed
colorGradingBuffer.LutTexture == lutTexture)
{
@@ -203,6 +220,9 @@ GPUTexture* ColorGradingPass::RenderLUT(RenderContext& renderContext)
colorGradingBuffer.CachedData = data;
colorGradingBuffer.Mode = toneMapping.Mode;
colorGradingBuffer.LutTexture = lutTexture;
#if COMPILE_WITH_DEV_ENV
colorGradingBuffer.FrameRendered = Engine::FrameCount;
#endif
// Render LUT
PROFILE_GPU("Color Grading LUT");

View File

@@ -25,11 +25,8 @@ public:
private:
#if COMPILE_WITH_DEV_ENV
void OnShaderReloading(Asset* obj)
{
_psLut.Release();
invalidateResources();
}
uint64 _reloadedFrame = 0;
void OnShaderReloading(Asset* obj);
#endif
public:

View File

@@ -98,6 +98,7 @@ void EyeAdaptationPass::Render(RenderContext& renderContext, GPUTexture* colorBu
if (mode == EyeAdaptationMode::Manual)
{
// Apply fixed manual exposure
context->ResetSR();
context->SetRenderTarget(*colorBuffer);
context->SetViewportAndScissors((float)colorBuffer->Width(), (float)colorBuffer->Height());
context->SetState(_psManual);

View File

@@ -30,6 +30,9 @@ GPU_CB_STRUCT(Data {
Float2 Input0SizeInv;
Float2 Input2SizeInv;
Float3 PrevWorldOriginOffset;
float Dummy1;
});
MotionBlurPass::MotionBlurPass()
@@ -194,6 +197,7 @@ void MotionBlurPass::RenderMotionVectors(RenderContext& renderContext)
Matrix::Transpose(renderContext.View.ViewProjection(), data.CurrentVP);
Matrix::Transpose(renderContext.View.PrevViewProjection, data.PreviousVP);
data.TemporalAAJitter = renderContext.View.TemporalAAJitter;
data.PrevWorldOriginOffset = renderContext.View.Origin - renderContext.View.PrevOrigin;
auto cb = _shader->GetShader()->GetCB(0);
context->UpdateCB(cb, &data);
context->BindCB(0, cb);

View File

@@ -1798,6 +1798,33 @@ bool InitHostfxr()
get_hostfxr_params.dotnet_root = dotnetRoot.Get();
}
#endif
String platformStr;
switch (PLATFORM_TYPE)
{
case PlatformType::Windows:
case PlatformType::UWP:
if (PLATFORM_ARCH == ArchitectureType::x64)
platformStr = "Windows x64";
else if (PLATFORM_ARCH == ArchitectureType::ARM64)
platformStr = "Windows ARM64";
else
platformStr = "Windows x86";
break;
case PlatformType::Linux:
platformStr = PLATFORM_ARCH_ARM64 ? "Linux ARM64" : PLATFORM_ARCH_ARM ? "Linux Arm32" : PLATFORM_64BITS ? "Linux x64" : "Linux x86";
break;
case PlatformType::Mac:
platformStr = PLATFORM_ARCH_ARM || PLATFORM_ARCH_ARM64 ? "macOS ARM64" : PLATFORM_64BITS ? "macOS x64" : "macOS x86";
break;
default:
if (PLATFORM_ARCH == ArchitectureType::x64)
platformStr = "x64";
else if (PLATFORM_ARCH == ArchitectureType::ARM64)
platformStr = "ARM64";
else
platformStr = "x86";
}
char_t hostfxrPath[1024];
size_t hostfxrPathSize = sizeof(hostfxrPath) / sizeof(char_t);
int rc = get_hostfxr_path(hostfxrPath, &hostfxrPathSize, &get_hostfxr_params);
@@ -1810,9 +1837,9 @@ bool InitHostfxr()
Platform::OpenUrl(TEXT("https://dotnet.microsoft.com/en-us/download/dotnet"));
#endif
#if USE_EDITOR
LOG(Fatal, "Missing .NET 8 or later SDK installation required to run Flax Editor.");
LOG(Fatal, "Missing .NET 8 or later SDK installation for {0} is required to run Flax Editor.", platformStr);
#else
LOG(Fatal, "Missing .NET 8 or later Runtime installation required to run this application.");
LOG(Fatal, "Missing .NET 8 or later Runtime installation for {0} is required to run this application.", platformStr);
#endif
return true;
}
@@ -1870,27 +1897,6 @@ bool InitHostfxr()
hostfxr_close(handle);
if (rc == 0x80008096) // FrameworkMissingFailure
{
String platformStr;
switch (PLATFORM_TYPE)
{
case PlatformType::Windows:
case PlatformType::UWP:
if (PLATFORM_ARCH == ArchitectureType::x64)
platformStr = "Windows x64";
else if (PLATFORM_ARCH == ArchitectureType::ARM64)
platformStr = "Windows ARM64";
else
platformStr = "Windows x86";
break;
case PlatformType::Linux:
platformStr = PLATFORM_ARCH_ARM64 ? "Linux ARM64" : PLATFORM_ARCH_ARM ? "Linux Arm32" : PLATFORM_64BITS ? "Linux x64" : "Linux x86";
break;
case PlatformType::Mac:
platformStr = PLATFORM_ARCH_ARM || PLATFORM_ARCH_ARM64 ? "macOS ARM64" : PLATFORM_64BITS ? "macOS x64" : "macOS x86";
break;
default:;
platformStr = "";
}
LOG(Fatal, "Failed to resolve compatible .NET runtime version in '{0}'. Make sure the correct platform version for runtime is installed ({1})", platformStr, String(init_params.dotnet_root));
}
else

View File

@@ -32,7 +32,7 @@ public class Scripting : EngineModule
options.ScriptingAPI.Defines.Add("NET");
AddFrameworkDefines("NET{0}_{1}", dotnetSdk.Version.Major, 0); // "NET7_0"
for (int i = 5; i <= dotnetSdk.Version.Major; i++)
AddFrameworkDefines("NET{0}_{1}_OR_GREATER", dotnetSdk.Version.Major, 0); // "NET7_0_OR_GREATER"
AddFrameworkDefines("NET{0}_{1}_OR_GREATER", i, 0); // "NET7_0_OR_GREATER"
options.ScriptingAPI.Defines.Add("NETCOREAPP");
AddFrameworkDefines("NETCOREAPP{0}_{1}_OR_GREATER", 3, 1); // "NETCOREAPP3_1_OR_GREATER"
AddFrameworkDefines("NETCOREAPP{0}_{1}_OR_GREATER", 2, 2);

View File

@@ -563,8 +563,8 @@ FORCE_INLINE int32 GetVTableIndex(void** vtable, int32 entriesCount, void* func)
offset = ((*op & 0x3FFC00) >> 10) * ((*op & 0x40000000) != 0 ? 8 : 4);
return offset / sizeof(void*);
}
CRASH;
}
CRASH;
#elif defined(__clang__)
// On Clang member function pointer represents the offset from the vtable begin.
return (int32)(intptr)func / sizeof(void*);

View File

@@ -32,6 +32,7 @@ public:
}
public:
using JsonWriter::Key;
// [JsonWriter]
void Key(const char* str, int32 length) override

View File

@@ -65,6 +65,8 @@
#endif
#undef MessageBox
static void stbWrite(void* context, void* data, int size)
{
auto file = (FileWriteStream*)context;

View File

@@ -390,7 +390,7 @@ public class Slider : ContainerControl
}
// Draw thumb
var thumbColorV = _isSliding ? ThumbColorSelected : (_mouseOverThumb ? ThumbColorHighlighted : ThumbColor);
var thumbColorV = _isSliding ? ThumbColorSelected : (_mouseOverThumb || IsNavFocused ? ThumbColorHighlighted : ThumbColor);
if (ThumbBrush != null)
ThumbBrush.Draw(_thumbRect, thumbColorV);
else

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -164,16 +164,14 @@ float3 TonemapACES(float3 linearColor)
// The code was originally written by Stephen Hill (@self_shadow).
// sRGB => XYZ => D65_2_D60 => AP1 => RRT_SAT
static const float3x3 ACESInputMat =
{
static const float3x3 ACESInputMat = {
{0.59719, 0.35458, 0.04823},
{0.07600, 0.90834, 0.01566},
{0.02840, 0.13383, 0.83777}
};
// ODT_SAT => XYZ => D60_2_D65 => sRGB
static const float3x3 ACESOutputMat =
{
static const float3x3 ACESOutputMat = {
{ 1.60475, -0.53108, -0.07367},
{-0.10208, 1.10813, -0.00605},
{-0.00327, -0.07276, 1.07602}
@@ -188,6 +186,7 @@ float3 TonemapACES(float3 linearColor)
color = a / b;
color = mul(ACESOutputMat, color);
return saturate(color);
}

View File

@@ -37,7 +37,7 @@ float4 FastTonemapInvert(float4 c)
return float4(FastTonemapInvert(c.rgb), c.a);
}
float LinearToSrgbChannel(float linearColor)
float LinearToSrgb(float linearColor)
{
if (linearColor < 0.00313067)
return linearColor * 12.92;
@@ -46,10 +46,7 @@ float LinearToSrgbChannel(float linearColor)
float3 LinearToSrgb(float3 linearColor)
{
return float3(
LinearToSrgbChannel(linearColor.r),
LinearToSrgbChannel(linearColor.g),
LinearToSrgbChannel(linearColor.b));
return float3(LinearToSrgb(linearColor.r), LinearToSrgb(linearColor.g), LinearToSrgb(linearColor.b));
}
float3 sRGBToLinear(float3 color)

View File

@@ -21,6 +21,8 @@ int MaxBlurSamples;
uint VariableTileLoopCount;
float2 Input0SizeInv;
float2 Input2SizeInv;
float3 PrevWorldOriginOffset;
float Dummy1;
META_CB_END
DECLARE_GBUFFERDATA_ACCESS(GBuffer)
@@ -39,7 +41,7 @@ float4 PS_CameraMotionVectors(Quad_VS2PS input) : SV_Target
GBufferData gBufferData = GetGBufferData();
float4 worldPos = float4(GetWorldPos(gBufferData, input.TexCoord, deviceDepth), 1);
float4 prevClipPos = mul(worldPos, PreviousVP);
float4 prevClipPos = mul(worldPos + float4(PrevWorldOriginOffset, 0), PreviousVP);
float4 curClipPos = mul(worldPos, CurrentVP);
float2 prevHPos = prevClipPos.xy / prevClipPos.w;
float2 curHPos = curClipPos.xy / curClipPos.w;

View File

@@ -72,7 +72,11 @@ __BEGIN_DECLS
#include <stdint.h>
#include <stdbool.h>
#if defined(_MSC_VER)
#define DETEX_INLINE_ONLY __forceinline
#else
#define DETEX_INLINE_ONLY __attribute__((always_inline)) inline
#endif
#define DETEX_RESTRICT __restrict
/* Maximum uncompressed block size in bytes. */

View File

@@ -6,6 +6,10 @@
#include "../common/TracyYield.hpp"
#if PLATFORM_WINDOWS
extern void CheckInstructionSet();
#endif
namespace tracy
{
@@ -18,6 +22,10 @@ tracy_no_inline static void InitRpmallocPlumbing()
const auto done = RpInitDone.load( std::memory_order_acquire );
if( !done )
{
#if PLATFORM_WINDOWS
// Check instruction set before executing any code (Tracy init static vars before others)
CheckInstructionSet();
#endif
int expected = 0;
while( !RpInitLock.compare_exchange_weak( expected, 1, std::memory_order_release, std::memory_order_relaxed ) ) { expected = 0; YieldThread(); }
const auto done = RpInitDone.load( std::memory_order_acquire );

View File

@@ -115,7 +115,7 @@ namespace Flax.Build
/// Init with a proper message.
/// </summary>
public MissingException()
: base(string.IsNullOrEmpty(Configuration.Dotnet) ? $"Missing .NET SDK {MinimumVersion} (or higher)." : $"Missing .NET SDK {Configuration.Dotnet}.")
: base(string.IsNullOrEmpty(Configuration.Dotnet) ? $"Missing .NET SDK {MinimumVersion} (or higher) for {Platform.BuildTargetPlatform} {Platform.BuildTargetArchitecture}." : $"Missing .NET SDK {Configuration.Dotnet}.")
{
}
}
@@ -135,7 +135,7 @@ namespace Flax.Build
/// <summary>
/// The maximum SDK version.
/// </summary>
public static Version MaximumVersion => new Version(9, 0);
public static Version MaximumVersion => new Version(10, 0);
/// <inheritdoc />
public override TargetPlatform[] Platforms
@@ -218,8 +218,8 @@ namespace Flax.Build
using RegistryKey runtimeKey = baseKey.OpenSubKey(@$"SOFTWARE\WOW6432Node\dotnet\Setup\InstalledVersions\{arch}\sharedfx\Microsoft.NETCore.App");
using RegistryKey hostKey = baseKey.OpenSubKey(@$"SOFTWARE\dotnet\Setup\InstalledVersions\{arch}\sharedhost");
dotnetPath = (string)hostKey.GetValue("Path");
dotnetSdkVersions = sdkVersionsKey.GetValueNames();
dotnetRuntimeVersions = runtimeKey.GetValueNames();
dotnetSdkVersions = sdkVersionsKey?.GetValueNames() ?? Enumerable.Empty<string>();
dotnetRuntimeVersions = runtimeKey?.GetValueNames() ?? Enumerable.Empty<string>();
}
#pragma warning restore CA1416
break;

View File

@@ -127,11 +127,12 @@ namespace Flax.Deps.Dependencies
{ "CC", "clang-" + Configuration.LinuxClangMinVer },
{ "CC_FOR_BUILD", "clang-" + Configuration.LinuxClangMinVer },
{ "CXX", "clang++-" + Configuration.LinuxClangMinVer },
{ "CMAKE_BUILD_PARALLEL_LEVEL", CmakeBuildParallel },
};
// Build for Linux
RunCmake(root, platform, TargetArchitecture.x64, " -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=OFF " + globalConfig, envVars);
Utilities.Run("make", null, null, root, Utilities.RunOptions.ThrowExceptionOnError, envVars);
Utilities.Run("make", null, null, root, Utilities.RunOptions.DefaultTool, envVars);
configHeaderFilePath = Path.Combine(root, "include", "assimp", "config.h");
var depsFolder = GetThirdPartyFolder(options, platform, TargetArchitecture.x64);
Utilities.FileCopy(Path.Combine(root, "lib", "libassimp.a"), Path.Combine(depsFolder, "libassimp.a"));
@@ -143,11 +144,11 @@ namespace Flax.Deps.Dependencies
foreach (var architecture in new[] { TargetArchitecture.x64, TargetArchitecture.ARM64 })
{
RunCmake(root, platform, architecture, " -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=OFF " + globalConfig);
Utilities.Run("make", null, null, root, Utilities.RunOptions.ThrowExceptionOnError);
Utilities.Run("make", null, null, root, Utilities.RunOptions.DefaultTool);
configHeaderFilePath = Path.Combine(root, "include", "assimp", "config.h");
var depsFolder = GetThirdPartyFolder(options, platform, architecture);
Utilities.FileCopy(Path.Combine(root, "lib", "libassimp.a"), Path.Combine(depsFolder, "libassimp.a"));
Utilities.Run("make", "clean", null, root, Utilities.RunOptions.ThrowExceptionOnError);
Utilities.Run("make", "clean", null, root, Utilities.RunOptions.DefaultTool);
}
break;
}

View File

@@ -115,6 +115,7 @@ namespace Flax.Deps.Dependencies
var buildFolder = Path.Combine(nvCloth, "compiler", platform.ToString() + '_' + architecture.ToString());
var envVars = new Dictionary<string, string>();
envVars["GW_DEPS_ROOT"] = root;
envVars["CMAKE_BUILD_PARALLEL_LEVEL"] = CmakeBuildParallel;
switch (platform)
{
case TargetPlatform.Windows:
@@ -166,6 +167,8 @@ namespace Flax.Deps.Dependencies
cmakeArgs += " -DTARGET_BUILD_PLATFORM=linux";
cmakeName = "linux";
binariesPrefix = "lib";
envVars.Add("CC", "clang-" + Configuration.LinuxClangMinVer);
envVars.Add("CXX", "clang++-" + Configuration.LinuxClangMinVer);
break;
default: throw new InvalidPlatformException(platform);
}

View File

@@ -52,6 +52,7 @@ namespace Flax.Deps.Dependencies
var version = "1.24.3";
var configuration = "Release";
var dstIncludePath = Path.Combine(options.ThirdPartyFolder, "OpenAL");
var noSSL = true; // OpenAL Soft website has broken certs
foreach (var platform in options.Platforms)
{
@@ -87,7 +88,7 @@ namespace Flax.Deps.Dependencies
// Get the binaries
var packagePath = Path.Combine(root, "package.zip");
if (!File.Exists(packagePath))
Downloader.DownloadFileFromUrlToPath("https://openal-soft.org/openal-binaries/openal-soft-" + version + "-bin.zip", packagePath);
Downloader.DownloadFileFromUrlToPath("https://openal-soft.org/openal-binaries/openal-soft-" + version + "-bin.zip", packagePath, noSSL);
using (ZipArchive archive = ZipFile.Open(packagePath, ZipArchiveMode.Read))
{
if (!Directory.Exists(root))
@@ -122,6 +123,7 @@ namespace Flax.Deps.Dependencies
{
{ "CC", "clang-" + Configuration.LinuxClangMinVer },
{ "CC_FOR_BUILD", "clang-" + Configuration.LinuxClangMinVer },
{ "CXX", "clang++-" + Configuration.LinuxClangMinVer },
{ "CMAKE_BUILD_PARALLEL_LEVEL", CmakeBuildParallel },
};
var config = $"-DALSOFT_REQUIRE_ALSA=ON " +
@@ -135,7 +137,7 @@ namespace Flax.Deps.Dependencies
// Get the source
var packagePath = Path.Combine(root, "package.zip");
File.Delete(packagePath);
Downloader.DownloadFileFromUrlToPath("https://openal-soft.org/openal-releases/openal-soft-" + version + ".tar.bz2", packagePath);
Downloader.DownloadFileFromUrlToPath("https://openal-soft.org/openal-releases/openal-soft-" + version + ".tar.bz2", packagePath, noSSL);
Utilities.Run("tar", "xjf " + packagePath.Replace('\\', '/'), null, root, Utilities.RunOptions.ConsoleLogOutput);
// Use separate build directory
@@ -166,7 +168,7 @@ namespace Flax.Deps.Dependencies
// Get the source
var packagePath = Path.Combine(root, "package.zip");
File.Delete(packagePath);
Downloader.DownloadFileFromUrlToPath("https://openal-soft.org/openal-releases/openal-soft-" + version + ".tar.bz2", packagePath);
Downloader.DownloadFileFromUrlToPath("https://openal-soft.org/openal-releases/openal-soft-" + version + ".tar.bz2", packagePath, noSSL);
if (Platform.BuildTargetPlatform == TargetPlatform.Windows)
{
var sevenZip = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles), "7-Zip", "7z.exe");
@@ -206,7 +208,7 @@ namespace Flax.Deps.Dependencies
// Get the source
var packagePath = Path.Combine(root, "package.zip");
File.Delete(packagePath);
Downloader.DownloadFileFromUrlToPath("https://openal-soft.org/openal-releases/openal-soft-" + version + ".tar.bz2", packagePath);
Downloader.DownloadFileFromUrlToPath("https://openal-soft.org/openal-releases/openal-soft-" + version + ".tar.bz2", packagePath, noSSL);
Utilities.Run("tar", "xjf " + packagePath.Replace('\\', '/'), null, root, Utilities.RunOptions.ConsoleLogOutput);
// Use separate build directory
@@ -241,7 +243,7 @@ namespace Flax.Deps.Dependencies
var packagePath = Path.Combine(root, "package.zip");
if (!File.Exists(packagePath))
{
Downloader.DownloadFileFromUrlToPath("https://openal-soft.org/openal-releases/openal-soft-" + version + ".tar.bz2", packagePath);
Downloader.DownloadFileFromUrlToPath("https://openal-soft.org/openal-releases/openal-soft-" + version + ".tar.bz2", packagePath, noSSL);
Utilities.Run("tar", "xjf " + packagePath.Replace('\\', '/'), null, root, Utilities.RunOptions.ConsoleLogOutput);
}

View File

@@ -238,6 +238,8 @@ namespace Flax.Deps.Dependencies
case TargetPlatform.Linux:
envVars.Add("CC", "clang-" + Configuration.LinuxClangMinVer);
envVars.Add("CC_FOR_BUILD", "clang-" + Configuration.LinuxClangMinVer);
envVars.Add("CXX", "clang++-" + Configuration.LinuxClangMinVer);
envVars.Add("CMAKE_BUILD_PARALLEL_LEVEL", CmakeBuildParallel);
break;
case TargetPlatform.Mac: break;
default: throw new InvalidPlatformException(BuildPlatform);
@@ -258,7 +260,7 @@ namespace Flax.Deps.Dependencies
Log.Info("Building PhysX version " + File.ReadAllText(Path.Combine(root, "physx", "version.txt")) + " to " + binariesSubDir);
// Generate project files
Utilities.Run(projectGenPath, preset, null, projectGenDir, Utilities.RunOptions.ThrowExceptionOnError, envVars);
Utilities.Run(projectGenPath, preset, null, projectGenDir, Utilities.RunOptions.DefaultTool, envVars);
switch (targetPlatform)
{
@@ -304,10 +306,10 @@ namespace Flax.Deps.Dependencies
}
break;
case TargetPlatform.Linux:
Utilities.Run("make", null, null, Path.Combine(projectGenDir, "compiler", "linux-" + configuration), Utilities.RunOptions.ConsoleLogOutput);
Utilities.Run("make", null, null, Path.Combine(projectGenDir, "compiler", "linux-" + configuration), Utilities.RunOptions.ConsoleLogOutput, envVars);
break;
case TargetPlatform.Mac:
Utilities.Run("xcodebuild", "-project PhysXSDK.xcodeproj -alltargets -configuration " + configuration, null, Path.Combine(projectGenDir, "compiler", preset), Utilities.RunOptions.ConsoleLogOutput);
Utilities.Run("xcodebuild", "-project PhysXSDK.xcodeproj -alltargets -configuration " + configuration, null, Path.Combine(projectGenDir, "compiler", preset), Utilities.RunOptions.ConsoleLogOutput, envVars);
break;
default: throw new InvalidPlatformException(BuildPlatform);
}

View File

@@ -107,13 +107,14 @@ namespace Flax.Deps.Dependencies
{
{ "CC", "clang-" + Configuration.LinuxClangMinVer },
{ "CC_FOR_BUILD", "clang-" + Configuration.LinuxClangMinVer },
{ "CMAKE_BUILD_PARALLEL_LEVEL", CmakeBuildParallel },
};
var buildDir = Path.Combine(root, "build");
SetupDirectory(buildDir, true);
Utilities.Run("chmod", "+x configure", null, root, Utilities.RunOptions.ThrowExceptionOnError);
Utilities.Run(Path.Combine(root, "configure"), string.Join(" ", settings) + " --prefix=\"" + buildDir + "\"", null, root, Utilities.RunOptions.ThrowExceptionOnError, envVars);
Utilities.Run("make", null, null, root, Utilities.RunOptions.ThrowExceptionOnError);
Utilities.Run("make", "install", null, root, Utilities.RunOptions.ThrowExceptionOnError);
Utilities.Run("chmod", "+x configure", null, root, Utilities.RunOptions.DefaultTool);
Utilities.Run(Path.Combine(root, "configure"), string.Join(" ", settings) + " --prefix=\"" + buildDir + "\"", null, root, Utilities.RunOptions.DefaultTool, envVars);
Utilities.Run("make", null, null, root, Utilities.RunOptions.DefaultTool);
Utilities.Run("make", "install", null, root, Utilities.RunOptions.DefaultTool);
var depsFolder = GetThirdPartyFolder(options, platform, TargetArchitecture.x64);
var filename = "libcurl.a";
Utilities.FileCopy(Path.Combine(buildDir, "lib", filename), Path.Combine(depsFolder, filename));
@@ -153,11 +154,11 @@ namespace Flax.Deps.Dependencies
};
var buildDir = Path.Combine(root, "build");
SetupDirectory(buildDir, true);
Utilities.Run("chmod", "+x configure", null, root, Utilities.RunOptions.ThrowExceptionOnError);
Utilities.Run("chmod", "+x install-sh", null, root, Utilities.RunOptions.ThrowExceptionOnError);
Utilities.Run(Path.Combine(root, "configure"), string.Join(" ", settings) + " --host=" + archName + " --prefix=\"" + buildDir + "\"", null, root, Utilities.RunOptions.ThrowExceptionOnError, envVars);
Utilities.Run("make", null, null, root, Utilities.RunOptions.ThrowExceptionOnError);
Utilities.Run("make", "install", null, root, Utilities.RunOptions.ThrowExceptionOnError);
Utilities.Run("chmod", "+x configure", null, root, Utilities.RunOptions.DefaultTool);
Utilities.Run("chmod", "+x install-sh", null, root, Utilities.RunOptions.DefaultTool);
Utilities.Run(Path.Combine(root, "configure"), string.Join(" ", settings) + " --host=" + archName + " --prefix=\"" + buildDir + "\"", null, root, Utilities.RunOptions.DefaultTool, envVars);
Utilities.Run("make", null, null, root, Utilities.RunOptions.DefaultTool);
Utilities.Run("make", "install", null, root, Utilities.RunOptions.DefaultTool);
var depsFolder = GetThirdPartyFolder(options, platform, architecture);
var filename = "libcurl.a";
Utilities.FileCopy(Path.Combine(buildDir, "lib", filename), Path.Combine(depsFolder, filename));

View File

@@ -114,19 +114,22 @@ namespace Flax.Deps.Dependencies
}
case TargetPlatform.Linux:
{
var envVars = new Dictionary<string, string>
var envVars = new Dictionary<string, string>
{
{ "CC", "clang-" + Configuration.LinuxClangMinVer },
{ "CC_FOR_BUILD", "clang-" + Configuration.LinuxClangMinVer }
{ "CC_FOR_BUILD", "clang-" + Configuration.LinuxClangMinVer },
{ "CMAKE_BUILD_PARALLEL_LEVEL", CmakeBuildParallel },
};
// Fix scripts
Utilities.Run("sed", "-i -e \'s/\r$//\' autogen.sh", null, root, Utilities.RunOptions.ThrowExceptionOnError, envVars);
Utilities.Run("sed", "-i -e \'s/\r$//\' configure", null, root, Utilities.RunOptions.ThrowExceptionOnError, envVars);
Utilities.Run("dos2unix", "autogen.sh", null, root, Utilities.RunOptions.ThrowExceptionOnError, envVars);
Utilities.Run("dos2unix", "configure", null, root, Utilities.RunOptions.ThrowExceptionOnError, envVars);
//Utilities.Run("sed", "-i -e \'s/\r$//\' autogen.sh", null, root, Utilities.RunOptions.ThrowExceptionOnError, envVars);
//Utilities.Run("sed", "-i -e \'s/\r$//\' configure", null, root, Utilities.RunOptions.ThrowExceptionOnError, envVars);
Utilities.Run("chmod", "+x autogen.sh", null, root, Utilities.RunOptions.ThrowExceptionOnError);
Utilities.Run("chmod", "+x configure", null, root, Utilities.RunOptions.ThrowExceptionOnError);
Utilities.Run(Path.Combine(root, "autogen.sh"), null, null, root, Utilities.RunOptions.Default, envVars);
Utilities.Run(Path.Combine(root, "autogen.sh"), null, null, root, Utilities.RunOptions.ThrowExceptionOnError, envVars);
// Disable using libpng even if it's found on the system
var cmakeFile = Path.Combine(root, "CMakeLists.txt");
@@ -140,8 +143,8 @@ namespace Flax.Deps.Dependencies
// Build for Linux
SetupDirectory(buildDir, true);
var toolchain = UnixToolchain.GetToolchainName(platform, TargetArchitecture.x64);
Utilities.Run("cmake", string.Format("-G \"Unix Makefiles\" -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DFT_WITH_BZIP2=OFF -DFT_WITH_ZLIB=OFF -DFT_WITH_PNG=OFF -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER_TARGET={0} ..", toolchain), null, buildDir, Utilities.RunOptions.ThrowExceptionOnError, envVars);
Utilities.Run("cmake", "--build .", null, buildDir, Utilities.RunOptions.ThrowExceptionOnError, envVars);
Utilities.Run("cmake", string.Format("-G \"Unix Makefiles\" -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DFT_WITH_BZIP2=OFF -DFT_WITH_ZLIB=OFF -DFT_WITH_PNG=OFF -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER_TARGET={0} ..", toolchain), null, buildDir, Utilities.RunOptions.DefaultTool, envVars);
Utilities.Run("cmake", "--build .", null, buildDir, Utilities.RunOptions.DefaultTool, envVars);
var depsFolder = GetThirdPartyFolder(options, platform, TargetArchitecture.x64);
Utilities.FileCopy(Path.Combine(buildDir, libraryFileName), Path.Combine(depsFolder, libraryFileName));

View File

@@ -303,9 +303,9 @@ namespace Flax.Deps.Dependencies
}
// Ensure to have dependencies installed
Utilities.Run("ninja", "--version", null, null, Utilities.RunOptions.ThrowExceptionOnError);
Utilities.Run("cmake", "--version", null, null, Utilities.RunOptions.ThrowExceptionOnError);
Utilities.Run("python", "--version", null, null, Utilities.RunOptions.ThrowExceptionOnError);
Utilities.Run("ninja", "--version", null, null, Utilities.RunOptions.DefaultTool);
Utilities.Run("cmake", "--version", null, null, Utilities.RunOptions.DefaultTool);
Utilities.Run("python", "--version", null, null, Utilities.RunOptions.DefaultTool);
// Get the source
if (!Directory.Exists(Path.Combine(root, ".git")))

View File

@@ -366,15 +366,17 @@ namespace Flax.Deps.Dependencies
var envVars = new Dictionary<string, string>
{
{ "CC", "clang-" + Configuration.LinuxClangMinVer },
{ "CC_FOR_BUILD", "clang-" + Configuration.LinuxClangMinVer }
{ "CC_FOR_BUILD", "clang-" + Configuration.LinuxClangMinVer },
{ "CXX", "clang++-" + Configuration.LinuxClangMinVer },
{ "CMAKE_BUILD_PARALLEL_LEVEL", CmakeBuildParallel },
};
var buildDir = Path.Combine(root, "build");
Utilities.Run(Path.Combine(root, "autogen.sh"), null, null, root, Utilities.RunOptions.Default, envVars);
Utilities.Run(Path.Combine(root, "autogen.sh"), null, null, root, Utilities.RunOptions.DefaultTool, envVars);
// Build for Linux
var toolchain = UnixToolchain.GetToolchainName(platform, TargetArchitecture.x64);
Utilities.Run(Path.Combine(root, "configure"), string.Format("--host={0}", toolchain), null, root, Utilities.RunOptions.Default, envVars);
Utilities.Run(Path.Combine(root, "configure"), string.Format("--host={0}", toolchain), null, root, Utilities.RunOptions.ThrowExceptionOnError, envVars);
SetupDirectory(buildDir, true);
Utilities.Run("cmake", "-G \"Unix Makefiles\" -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DCMAKE_BUILD_TYPE=Release ..", null, buildDir, Utilities.RunOptions.ConsoleLogOutput, envVars);
Utilities.Run("cmake", "--build .", null, buildDir, Utilities.RunOptions.ConsoleLogOutput, envVars);

View File

@@ -456,7 +456,7 @@ namespace Flax.Deps
case TargetPlatform.Mac: break;
default: throw new InvalidPlatformException(BuildPlatform);
}
Utilities.Run(path, args, null, workspace, Utilities.RunOptions.ThrowExceptionOnError, envVars);
Utilities.Run(path, args, null, workspace, Utilities.RunOptions.DefaultTool, envVars);
}
internal bool GetMsBuildForPlatform(TargetPlatform targetPlatform, out VisualStudioVersion vsVersion, out string msBuildPath)

View File

@@ -14,20 +14,20 @@ namespace Flax.Deps
/// </summary>
static class Downloader
{
private static bool IgnoreSSL = false;
private static bool NoSSL = false;
private const string GoogleDriveDomain = "drive.google.com";
private const string GoogleDriveDomain2 = "https://drive.google.com";
// Normal example: FileDownloader.DownloadFileFromURLToPath( "http://example.com/file/download/link", @"C:\file.txt" );
// Drive example: FileDownloader.DownloadFileFromURLToPath( "http://drive.google.com/file/d/FILEID/view?usp=sharing", @"C:\file.txt" );
public static FileInfo DownloadFileFromUrlToPath(string url, string path)
public static FileInfo DownloadFileFromUrlToPath(string url, string path, bool noSSL = false)
{
Log.Info(string.Format("Downloading {0} to {1}", url, path));
if (File.Exists(path))
File.Delete(path);
if (url.StartsWith(GoogleDriveDomain) || url.StartsWith(GoogleDriveDomain2))
return DownloadGoogleDriveFileFromUrlToPath(url, path);
return DownloadFileFromUrlToPath(url, path, null);
return DownloadGoogleDriveFileFromUrlToPath(url, path, noSSL);
return DownloadFileFromUrlToPath(url, path, null, noSSL);
}
private static FileInfo DownloadFileFromUrlToPathRaw(string url, string path, HttpClient httpClient)
@@ -49,16 +49,14 @@ namespace Flax.Deps
return new FileInfo(path);
}
private static FileInfo DownloadFileFromUrlToPath(string url, string path, HttpClient httpClient)
private static FileInfo DownloadFileFromUrlToPath(string url, string path, HttpClient httpClient, bool noSSL)
{
try
{
if (httpClient == null)
{
using (httpClient = GetHttpClient())
{
using (httpClient = GetHttpClient(noSSL))
return DownloadFileFromUrlToPathRaw(url, path, httpClient);
}
}
return DownloadFileFromUrlToPathRaw(url, path, httpClient);
}
@@ -126,12 +124,12 @@ namespace Flax.Deps
// Downloading large files from Google Drive prompts a warning screen and
// requires manual confirmation. Consider that case and try to confirm the download automatically
// if warning prompt occurs
private static FileInfo DownloadGoogleDriveFileFromUrlToPath(string url, string path)
private static FileInfo DownloadGoogleDriveFileFromUrlToPath(string url, string path, bool noSSL)
{
// You can comment the statement below if the provided url is guaranteed to be in the following format:
// https://drive.google.com/uc?id=FILEID&export=download
url = GetGoogleDriveDownloadLinkFromUrl(url);
using (var httpClient = GetHttpClient())
using (var httpClient = GetHttpClient(noSSL))
{
FileInfo downloadedFile;
@@ -139,7 +137,7 @@ namespace Flax.Deps
// but works in the second attempt
for (int i = 0; i < 2; i++)
{
downloadedFile = DownloadFileFromUrlToPath(url, path, httpClient);
downloadedFile = DownloadFileFromUrlToPath(url, path, httpClient, noSSL);
if (downloadedFile == null)
return null;
@@ -172,7 +170,7 @@ namespace Flax.Deps
url = "https://drive.google.com" + content.Substring(linkIndex, linkEnd - linkIndex).Replace("&amp;", "&");
}
downloadedFile = DownloadFileFromUrlToPath(url, path, httpClient);
downloadedFile = DownloadFileFromUrlToPath(url, path, httpClient, noSSL);
return downloadedFile;
}
}
@@ -211,11 +209,10 @@ namespace Flax.Deps
return string.Format("https://drive.google.com/uc?id={0}&export=download", url.Substring(index, closingIndex - index));
}
private static HttpClient GetHttpClient()
private static HttpClient GetHttpClient(bool noSSL)
{
if (IgnoreSSL)
if (noSSL || NoSSL)
{
Log.Warning("Accessing HTTP with SSL certificate validation disabled!");
var handler = new HttpClientHandler();
handler.ClientCertificateOptions = ClientCertificateOption.Manual;
handler.ServerCertificateCustomValidationCallback = (httpRequestMessage, cert, cetChain, policyErrors) => true;

View File

@@ -65,7 +65,10 @@ namespace Flax.Build
if (ApplyConsoleColors)
Console.ForegroundColor = color;
Console.WriteLine(Indent + message);
if (color != ConsoleColor.Red)
Console.WriteLine(Indent + message);
else
Console.Error.WriteLine(Indent + message);
if (ApplyConsoleColors)
Console.ResetColor();

View File

@@ -14,7 +14,7 @@ namespace Flax.Build
/// Specifies the minimum Clang compiler version to use on Linux (eg. 10).
/// </summary>
[CommandLine("linuxClangMinVer", "<version>", "Specifies the minimum Clang compiler version to use on Linux (eg. 10).")]
public static string LinuxClangMinVer = "13";
public static string LinuxClangMinVer = "14";
}
}

View File

@@ -20,7 +20,7 @@ namespace Flax.Build
/// Specifies the minimum CPU architecture type to support (on x86/x64).
/// </summary>
[CommandLine("winCpuArch", "<arch>", "Specifies the minimum CPU architecture type to support (om x86/x64).")]
public static CpuArchitecture WindowsCpuArch = CpuArchitecture.AVX2; // 94.48% support on PC according to Steam Hardware & Software Survey: May 2025 (https://store.steampowered.com/hwsurvey/)
public static CpuArchitecture WindowsCpuArch = CpuArchitecture.SSE4_2; // 99.78% support on PC according to Steam Hardware & Software Survey: September 2025 (https://store.steampowered.com/hwsurvey/)
}
}

View File

@@ -114,7 +114,7 @@ namespace Flax.Build.Projects.VisualStudio
vcProjectFileContent.AppendLine(" <Keyword>MakeFileProj</Keyword>");
if (Version >= VisualStudioVersion.VisualStudio2022)
vcProjectFileContent.AppendLine(" <ResolveNuGetPackages>false</ResolveNuGetPackages>");
vcProjectFileContent.AppendLine(" <VCTargetsPath Condition=\"$(Configuration.Contains('Linux'))\">./</VCTargetsPath>");
vcProjectFileContent.AppendLine(" <VCTargetsPath Condition=\"$(Configuration.Contains('Linux')) or $(Configuration.Contains('Mac'))\">./</VCTargetsPath>");
vcProjectFileContent.AppendLine(" </PropertyGroup>");
// Default properties

View File

@@ -342,6 +342,8 @@ namespace Flax.Build.Projects.VisualStudioCode
json.BeginArray("args");
{
if (configuration.Platform == TargetPlatform.Linux || configuration.Platform == TargetPlatform.Mac)
json.AddUnnamedField("-std");
json.AddUnnamedField("-project");
json.AddUnnamedField(buildToolWorkspace);
json.AddUnnamedField("-skipCompile");
@@ -395,6 +397,8 @@ namespace Flax.Build.Projects.VisualStudioCode
json.AddField("program", Path.Combine(Globals.EngineRoot, "Binaries", "Editor", editorFolder, configuration.ConfigurationName, "FlaxEditor"));
json.BeginArray("args");
{
if (configuration.Platform == TargetPlatform.Linux || configuration.Platform == TargetPlatform.Mac)
json.AddUnnamedField("-std");
json.AddUnnamedField("-project");
json.AddUnnamedField(buildToolWorkspace);
json.AddUnnamedField("-skipCompile");