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

@@ -49,7 +49,7 @@ internal sealed unsafe class ChunkDebugView
private static object[] GetItems(ref readonly Chunk chunk)
{
#if !(DEBUG || GHOST_EDITOR)
#if !DEBUG
return [];
#else
var pData = chunk.GetUnsafePtr();
@@ -185,7 +185,7 @@ internal unsafe struct Archetype : IDisposable
private int _maxComponentID;
private int _entityIdsOffset;
// -1 means no cleanup component, 0 means haven't computed yet (since 0 is the empty archetype), positive value means the archetype id of the cleanup edge.
// 0 means no cleanup component (since 0 is the empty archetype), -1 means haven't computed yet, positive value means the archetype id of the cleanup edge.
internal int _cleanupEdge;
public readonly Identifier<Archetype> ID => _id;
@@ -248,7 +248,7 @@ internal unsafe struct Archetype : IDisposable
}
}
if (cleanupCount == 0)
if (cleanupCount > 0)
{
_cleanupEdge = -1;
}

View File

@@ -291,14 +291,15 @@ public unsafe partial class EntityManager : IDisposable
ref var archetype = ref _world.ComponentManager.GetArchetypeReference(location.archetypeID);
if (archetype._cleanupEdge < 0)
// 0 means no cleanup component (since 0 is the empty archetype), -1 means haven't computed yet, positive value means the archetype id of the cleanup edge.
if (archetype._cleanupEdge == 0)
{
return DestroyEntity_Internal(entity, location);
}
else
{
Identifier<Archetype> newArcID = default;
if (archetype._cleanupEdge == 0)
if (archetype._cleanupEdge < 0)
{
ref var signature = ref archetype._signature;

View File

@@ -7,11 +7,6 @@
<AllowUnsafeBlocks>True</AllowUnsafeBlocks>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<IsAotCompatible>True</IsAotCompatible>
<IsTrimmable>True</IsTrimmable>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
<IsAotCompatible>True</IsAotCompatible>
<IsTrimmable>True</IsTrimmable>