feat: implement asynchronous asset management system with texture streaming support

This commit is contained in:
2026-04-20 01:09:59 +09:00
parent 4f5556ee1b
commit ed00f205b0
64 changed files with 1385 additions and 1157 deletions

View File

@@ -17,7 +17,7 @@ public sealed class AssetHandlerRegistry
_versionByTypeId = new Dictionary<Guid, int>();
}
public void RegisterHandler(IAssetHandler handler, ReadOnlySpan<string> extensions, Guid typeId, int version)
public void RegisterHandler(IAssetHandler handler, Guid typeId, ReadOnlySpan<string> extensions, int version)
{
_byTypeId[typeId] = handler;
_versionByTypeId[typeId] = version;

View File

@@ -193,9 +193,12 @@ public class TextureAssetSettings : IAssetSettings
} = new SamplerSettings();
}
[CustomAssetHandler(TextureAsset.TYPE_ID, [".png", ".jpg", ".jpeg", ".tga", ".bmp", ".hdr"], 1)]
[CustomAssetHandler(_GUID, [".png", ".jpg", ".jpeg", ".tga", ".bmp", ".hdr"], 1)]
[Guid(_GUID)]
internal class TextureAssetHandler : IAssetHandler
{
private const string _GUID = "27965FFF-860C-40EF-9123-1874D7DE9CDC";
public IAssetSettings? CreateDefaultSettings()
{
return new TextureAssetSettings();

View File

@@ -3,8 +3,8 @@ using Ghost.Editor.Core;
using Ghost.Editor.Core.Contracts;
using Ghost.Editor.Core.Services;
using Ghost.Editor.Core.Utilities;
using Ghost.Editor.View.Pages.EngineEditor;
using Ghost.Editor.View.Windows;
using Ghost.Editor.Views.Pages.EngineEditor;
using Ghost.Editor.Views.Windows;
using Ghost.Editor.ViewModels.Controls;
using Ghost.Editor.ViewModels.Pages.EngineEditor;
using Ghost.Editor.ViewModels.Windows;

View File

@@ -1,7 +1,7 @@
using System;
using System.Collections.ObjectModel;
namespace Ghost.Editor.View.Controls.Docking;
namespace Ghost.Editor.Views.Controls.Docking;
/// <summary>
/// Base class for containers that can hold other dock modules.

View File

@@ -1,7 +1,7 @@
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Controls;
namespace Ghost.Editor.View.Controls.Docking;
namespace Ghost.Editor.Views.Controls.Docking;
/// <summary>
/// Represents a document module in the docking system.

View File

@@ -1,7 +1,7 @@
<ResourceDictionary
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:Ghost.Editor.View.Controls.Docking">
xmlns:local="using:Ghost.Editor.Views.Controls.Docking">
<Style TargetType="local:DockDocument">
<Setter Property="HorizontalContentAlignment" Value="Stretch" />

View File

@@ -2,7 +2,7 @@ using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Controls;
using Microsoft.UI.Xaml.Data;
namespace Ghost.Editor.View.Controls.Docking;
namespace Ghost.Editor.Views.Controls.Docking;
/// <summary>
/// A container that displays its children (documents) as tabs.

View File

@@ -1,7 +1,7 @@
<ResourceDictionary
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:Ghost.Editor.View.Controls.Docking">
xmlns:local="using:Ghost.Editor.Views.Controls.Docking">
<Style TargetType="local:DockGroup">
<Setter Property="Template">

View File

@@ -1,6 +1,6 @@
using Microsoft.UI.Xaml.Controls;
namespace Ghost.Editor.View.Controls.Docking;
namespace Ghost.Editor.Views.Controls.Docking;
/// <summary>
/// Base class for all dockable modules in the docking system.

View File

@@ -3,7 +3,7 @@ using Microsoft.UI.Xaml.Controls;
using CommunityToolkit.WinUI.Controls;
using Windows.Foundation;
namespace Ghost.Editor.View.Controls.Docking;
namespace Ghost.Editor.Views.Controls.Docking;
/// <summary>
/// A container that can host multiple dock modules with splitters.

View File

@@ -1,7 +1,7 @@
<ResourceDictionary
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:Ghost.Editor.View.Controls.Docking">
xmlns:local="using:Ghost.Editor.Views.Controls.Docking">
<Style TargetType="local:DockPanel">
<Setter Property="Template">

View File

@@ -1,6 +1,6 @@
using Microsoft.UI.Xaml.Controls;
namespace Ghost.Editor.View.Controls.Docking;
namespace Ghost.Editor.Views.Controls.Docking;
/// <summary>
/// Represents a visual highlight for a docking region.

View File

@@ -1,7 +1,7 @@
<ResourceDictionary
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:Ghost.Editor.View.Controls.Docking">
xmlns:local="using:Ghost.Editor.Views.Controls.Docking">
<Style TargetType="local:DockRegionHighlight">
<Setter Property="Template">

View File

@@ -1,7 +1,7 @@
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Controls;
namespace Ghost.Editor.View.Controls.Docking;
namespace Ghost.Editor.Views.Controls.Docking;
/// <summary>
/// The root control for the docking system layout.

View File

@@ -1,7 +1,7 @@
<ResourceDictionary
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:Ghost.Editor.View.Controls.Docking">
xmlns:local="using:Ghost.Editor.Views.Controls.Docking">
<Style TargetType="local:DockingLayout">
<Setter Property="Template">

View File

@@ -1,4 +1,4 @@
namespace Ghost.Editor.View.Controls.Docking;
namespace Ghost.Editor.Views.Controls.Docking;
public enum DockTarget
{

View File

@@ -1,6 +1,6 @@
using Microsoft.UI.Xaml;
namespace Ghost.Editor.View.Controls.Docking;
namespace Ghost.Editor.Views.Controls.Docking;
/// <summary>
/// A floating window that contains a docking layout.

View File

@@ -1,10 +1,10 @@
<?xml version="1.0" encoding="utf-8" ?>
<UserControl
x:Class="Ghost.Editor.View.Controls.Hierarchy"
x:Class="Ghost.Editor.Views.Controls.Hierarchy"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="using:Ghost.Editor.View.Controls"
xmlns:local="using:Ghost.Editor.Views.Controls"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d">

View File

@@ -3,7 +3,7 @@ using Microsoft.UI.Xaml.Controls;
// To learn more about WinUI, the WinUI project structure,
// and more about our project templates, see: http://aka.ms/winui-project-info.
namespace Ghost.Editor.View.Controls;
namespace Ghost.Editor.Views.Controls;
public sealed partial class Hierarchy : UserControl
{

View File

@@ -1,6 +1,6 @@
using Ghost.Editor.Core;
namespace Ghost.Editor.View.Controls;
namespace Ghost.Editor.Views.Controls;
internal partial class ProjectBrowser
{

View File

@@ -1,13 +1,13 @@
<?xml version="1.0" encoding="utf-8" ?>
<UserControl
x:Class="Ghost.Editor.View.Controls.ProjectBrowser"
x:Class="Ghost.Editor.Views.Controls.ProjectBrowser"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:community="using:CommunityToolkit.WinUI.Controls"
xmlns:converter="using:Ghost.Editor.Utilities.Converters"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:ghost="using:Ghost.Editor.Core.Controls"
xmlns:local="using:Ghost.Editor.View.Controls"
xmlns:local="using:Ghost.Editor.Views.Controls"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:model="using:Ghost.Editor.Models"
xmlns:sys="using:System"

View File

@@ -6,7 +6,7 @@ using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Controls;
using Microsoft.UI.Xaml.Input;
namespace Ghost.Editor.View.Controls;
namespace Ghost.Editor.Views.Controls;
internal sealed partial class ProjectBrowser : UserControl
{

View File

@@ -1,10 +1,10 @@
<?xml version="1.0" encoding="utf-8" ?>
<Page
x:Class="Ghost.Editor.View.Pages.EngineEditor.ConsolePage"
x:Class="Ghost.Editor.Views.Pages.EngineEditor.ConsolePage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="using:Ghost.Editor.View.Pages.EngineEditor"
xmlns:local="using:Ghost.Editor.Views.Pages.EngineEditor"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d">

View File

@@ -1,7 +1,7 @@
using Ghost.Editor.ViewModels.Pages.EngineEditor;
using Microsoft.UI.Xaml.Controls;
namespace Ghost.Editor.View.Pages.EngineEditor;
namespace Ghost.Editor.Views.Pages.EngineEditor;
internal sealed partial class ConsolePage : Page
{

View File

@@ -1,11 +1,11 @@
<?xml version="1.0" encoding="utf-8" ?>
<internal:NavigationTabPage
x:Class="Ghost.Editor.View.Pages.EngineEditor.HierarchyPage"
x:Class="Ghost.Editor.Views.Pages.EngineEditor.HierarchyPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:internal="using:Ghost.Editor.Controls"
xmlns:local="using:Ghost.Editor.View.Pages.EngineEditor"
xmlns:local="using:Ghost.Editor.Views.Pages.EngineEditor"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:sg="using:Ghost.Editor.Core.SceneGraph"
mc:Ignorable="d">

View File

@@ -5,7 +5,7 @@ using Ghost.Editor.ViewModels.Pages.EngineEditor;
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Controls;
namespace Ghost.Editor.View.Pages.EngineEditor;
namespace Ghost.Editor.Views.Pages.EngineEditor;
internal sealed partial class HierarchyPage : NavigationTabPage
{

View File

@@ -1,11 +1,11 @@
<?xml version="1.0" encoding="utf-8" ?>
<internal:NavigationTabPage
x:Class="Ghost.Editor.View.Pages.EngineEditor.InspectorPage"
x:Class="Ghost.Editor.Views.Pages.EngineEditor.InspectorPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:internal="using:Ghost.Editor.Controls"
xmlns:local="using:Ghost.Editor.View.Pages.EngineEditor"
xmlns:local="using:Ghost.Editor.Views.Pages.EngineEditor"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d">

View File

@@ -1,7 +1,7 @@
using Ghost.Editor.Controls;
using Ghost.Editor.ViewModels.Pages.EngineEditor;
namespace Ghost.Editor.View.Pages.EngineEditor;
namespace Ghost.Editor.Views.Pages.EngineEditor;
internal sealed partial class InspectorPage : NavigationTabPage
{

View File

@@ -1,11 +1,11 @@
<?xml version="1.0" encoding="utf-8" ?>
<Page
x:Class="Ghost.Editor.View.Pages.EngineEditor.ProjectPage"
x:Class="Ghost.Editor.Views.Pages.EngineEditor.ProjectPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:converter="using:Ghost.Editor.Utilities.Converters"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="using:Ghost.Editor.View.Pages.EngineEditor"
xmlns:local="using:Ghost.Editor.Views.Pages.EngineEditor"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:model="using:Ghost.Editor.Models"
mc:Ignorable="d">

View File

@@ -2,7 +2,7 @@ using Ghost.Editor.ViewModels.Pages.EngineEditor;
using Microsoft.UI.Xaml.Controls;
using Microsoft.UI.Xaml.Input;
namespace Ghost.Editor.View.Pages.EngineEditor;
namespace Ghost.Editor.Views.Pages.EngineEditor;
internal sealed partial class ProjectPage : Page
{

View File

@@ -1,11 +1,11 @@
<?xml version="1.0" encoding="utf-8" ?>
<internal:NavigationTabPage
x:Class="Ghost.Editor.View.Pages.EngineEditor.ScenePage"
x:Class="Ghost.Editor.Views.Pages.EngineEditor.ScenePage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:internal="using:Ghost.Editor.Controls"
xmlns:local="using:Ghost.Editor.View.Pages.EngineEditor"
xmlns:local="using:Ghost.Editor.Views.Pages.EngineEditor"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d">

View File

@@ -4,7 +4,7 @@ using Ghost.Editor.Controls;
//using Microsoft.UI.Xaml.Controls;
//using WinRT;
namespace Ghost.Editor.View.Pages.EngineEditor;
namespace Ghost.Editor.Views.Pages.EngineEditor;
internal sealed partial class ScenePage : NavigationTabPage
{

View File

@@ -1,10 +1,10 @@
<?xml version="1.0" encoding="utf-8" ?>
<Window
x:Class="Ghost.Editor.View.Windows.BlankWindow1"
x:Class="Ghost.Editor.Views.Windows.BlankWindow1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="using:Ghost.Editor.View.Windows"
xmlns:local="using:Ghost.Editor.Views.Windows"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
Title="BlankWindow1"
mc:Ignorable="d">

View File

@@ -16,7 +16,7 @@ using Windows.Foundation.Collections;
// To learn more about WinUI, the WinUI project structure,
// and more about our project templates, see: http://aka.ms/winui-project-info.
namespace Ghost.Editor.View.Windows;
namespace Ghost.Editor.Views.Windows;
/// <summary>
/// An empty window that can be used on its own or navigated to within a Frame.
/// </summary>

View File

@@ -1,16 +1,16 @@
<?xml version="1.0" encoding="utf-8" ?>
<winex:WindowEx
x:Class="Ghost.Editor.View.Windows.EngineEditorWindow"
x:Class="Ghost.Editor.Views.Windows.EngineEditorWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:behaviors="using:CommunityToolkit.WinUI.Behaviors"
xmlns:controls="using:Ghost.Editor.View.Controls"
xmlns:controls="using:Ghost.Editor.Views.Controls"
xmlns:ctc="using:CommunityToolkit.WinUI.Controls"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:ee="using:Ghost.Editor.View.Pages.EngineEditor"
xmlns:ee="using:Ghost.Editor.Views.Pages.EngineEditor"
xmlns:ghost="using:Ghost.Editor.Controls"
xmlns:interactivity="using:Microsoft.Xaml.Interactivity"
xmlns:local="using:Ghost.Editor.View.Windows"
xmlns:local="using:Ghost.Editor.Views.Windows"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:winex="using:WinUIEx"
mc:Ignorable="d">
@@ -64,7 +64,7 @@
</ctc:TabbedCommandBar>
</Grid>
<Grid xmlns:dock="using:Ghost.Editor.View.Controls.Docking" Grid.Row="2">
<Grid xmlns:dock="using:Ghost.Editor.Views.Controls.Docking" Grid.Row="2">
<dock:DockingLayout x:Name="MainDockingLayout" />
</Grid>

View File

@@ -5,7 +5,7 @@ using Ghost.Editor.ViewModels.Windows;
using Windows.ApplicationModel;
using WinUIEx;
namespace Ghost.Editor.View.Windows;
namespace Ghost.Editor.Views.Windows;
/// <summary>
/// An empty window that can be used on its own or navigated to within a Frame.
/// </summary>

View File

@@ -1,10 +1,10 @@
<?xml version="1.0" encoding="utf-8" ?>
<winex:WindowEx
x:Class="Ghost.Editor.View.Windows.SplashWindow"
x:Class="Ghost.Editor.Views.Windows.SplashWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="using:Ghost.Editor.View.Windows"
xmlns:local="using:Ghost.Editor.Views.Windows"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:winex="using:WinUIEx"
Title="SplashWindow"

View File

@@ -3,7 +3,7 @@ using Microsoft.UI.Xaml;
using Windows.ApplicationModel;
using WinUIEx;
namespace Ghost.Editor.View.Windows;
namespace Ghost.Editor.Views.Windows;
/// <summary>
/// An empty window that can be used on its own or navigated to within a Frame.