Files
GhostEngine/src/Editor/Ghost.Editor/Utilities/Converters/AssetPathToGlyphConverter.cs
Misaki 6321b36ef5 feat(resource): refactor heap management & suballocation
Major overhaul of GPU resource/heap management:
- Replace resource pooling and upload buffer logic with transient heap/page-based suballocation in ResourceManager.
- Add support for suballocation and heap flags/types, with D3D12 helpers.
- Remove ICommandBuffer.UploadBuffer/UploadTexture; add UpdateSubResources and CopyBuffer, move upload logic to RenderingContext.
- Refactor D3D12ResourceAllocator/Database for suballocation, heap flags, and mapping.
- Standardize on Handle<GPUBuffer> usage.
- Update meshlet/mesh utilities for new allocation handles and memory pools.
- Refactor RenderGraph and docs to use "heap" terminology.
- Use cpuFrame/gpuFrame consistently for frame sync.
- Add s2h.hlsl, s2h_3d.hlsl, s2h_scatter.hlsl shader debug libs.
- Miscellaneous fixes, cleanup, and dependency updates.

BREAKING CHANGE: Resource pooling and upload APIs replaced with new heap/page-based suballocation system. Update all buffer/texture creation and upload code to use new ResourceManager and ICommandBuffer methods.
2026-04-03 01:48:49 +09:00

40 lines
1.1 KiB
C#

using Microsoft.UI.Xaml.Data;
namespace Ghost.Editor.Utilities.Converters;
public partial class AssetPathToGlyphConverter : IValueConverter
{
public object? Convert(object value, Type targetType, object parameter, string language)
{
if (value is not string path)
{
return null;
}
if (Directory.Exists(path))
{
return "\uE8B7";
}
var extension = Path.GetExtension(path).ToLowerInvariant();
// TODO: Use heap dictionary for icons.
return extension switch
{
".ghostscene" => "\uF159",
".fbx" or ".obj" => "\uF158",
".png" or ".jpg" or ".jpeg" or ".gif" or ".bmp" => "\uE91B",
".mp3" or ".wav" or ".ogg" => "\uE767",
".mp4" or ".avi" or ".mkv" => "\uE714",
".txt" or ".md" => "\uF000",
".cs" or ".hlsl" => "\uE943",
_ => "\uE8A5",
};
}
public object ConvertBack(object value, Type targetType, object parameter, string language)
{
throw new NotImplementedException();
}
}