feat(rendergraph): async queue, pool refactor, barrier cleanup
Refactor resource pool to use UnsafeQueue/UnsafeList for transient resources, improving memory management and performance. Add async GPU wait support to ICommandQueue and D3D12. Refactor render graph barrier system, streamline CompiledBarrier, and remove ResourceBarrier. RenderGraphCompiler now returns Result<float2, Error> for dynamic resolution scaling. Replace custom memory pools with Allocator.FreeList for temp allocations. Add ResourceUploadBatch for async/sync resource uploads. Fix D3D12 disposal and fence tracking bugs. Update NuGet dependencies. Numerous minor cleanups and code improvements.
This commit is contained in:
@@ -682,6 +682,14 @@ public ref partial struct QueryBuilder : IDisposable
|
||||
|
||||
public readonly void Dispose()
|
||||
{
|
||||
_all.Dispose();
|
||||
_any.Dispose();
|
||||
_absent.Dispose();
|
||||
_none.Dispose();
|
||||
_disabled.Dispose();
|
||||
_present.Dispose();
|
||||
_rw.Dispose();
|
||||
|
||||
_scope.Dispose();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -152,6 +152,7 @@ public unsafe partial struct EntityQuery
|
||||
|
||||
public readonly void Dispose()
|
||||
{
|
||||
_changedComponentIDs.Dispose();
|
||||
_scope.Dispose();
|
||||
}
|
||||
}
|
||||
@@ -354,6 +355,7 @@ public unsafe partial struct EntityQuery
|
||||
|
||||
public readonly void Dispose()
|
||||
{
|
||||
_changedComponentIDs.Dispose();
|
||||
_scope.Dispose();
|
||||
}
|
||||
}
|
||||
@@ -566,6 +568,7 @@ public unsafe partial struct EntityQuery
|
||||
|
||||
public readonly void Dispose()
|
||||
{
|
||||
_changedComponentIDs.Dispose();
|
||||
_scope.Dispose();
|
||||
}
|
||||
}
|
||||
@@ -788,6 +791,7 @@ public unsafe partial struct EntityQuery
|
||||
|
||||
public readonly void Dispose()
|
||||
{
|
||||
_changedComponentIDs.Dispose();
|
||||
_scope.Dispose();
|
||||
}
|
||||
}
|
||||
@@ -1020,6 +1024,7 @@ public unsafe partial struct EntityQuery
|
||||
|
||||
public readonly void Dispose()
|
||||
{
|
||||
_changedComponentIDs.Dispose();
|
||||
_scope.Dispose();
|
||||
}
|
||||
}
|
||||
@@ -1262,6 +1267,7 @@ public unsafe partial struct EntityQuery
|
||||
|
||||
public readonly void Dispose()
|
||||
{
|
||||
_changedComponentIDs.Dispose();
|
||||
_scope.Dispose();
|
||||
}
|
||||
}
|
||||
@@ -1514,6 +1520,7 @@ public unsafe partial struct EntityQuery
|
||||
|
||||
public readonly void Dispose()
|
||||
{
|
||||
_changedComponentIDs.Dispose();
|
||||
_scope.Dispose();
|
||||
}
|
||||
}
|
||||
@@ -1776,6 +1783,7 @@ public unsafe partial struct EntityQuery
|
||||
|
||||
public readonly void Dispose()
|
||||
{
|
||||
_changedComponentIDs.Dispose();
|
||||
_scope.Dispose();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -197,6 +197,7 @@ public unsafe partial struct EntityQuery
|
||||
|
||||
public readonly void Dispose()
|
||||
{
|
||||
_changedComponentIDs.Dispose();
|
||||
_scope.Dispose();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -175,6 +175,7 @@ public unsafe partial struct EntityQuery
|
||||
|
||||
public readonly void Dispose()
|
||||
{
|
||||
_changedComponentIDs.Dispose();
|
||||
_scope.Dispose();
|
||||
}
|
||||
}
|
||||
@@ -384,6 +385,7 @@ public unsafe partial struct EntityQuery
|
||||
|
||||
public readonly void Dispose()
|
||||
{
|
||||
_changedComponentIDs.Dispose();
|
||||
_scope.Dispose();
|
||||
}
|
||||
}
|
||||
@@ -603,6 +605,7 @@ public unsafe partial struct EntityQuery
|
||||
|
||||
public readonly void Dispose()
|
||||
{
|
||||
_changedComponentIDs.Dispose();
|
||||
_scope.Dispose();
|
||||
}
|
||||
}
|
||||
@@ -832,6 +835,7 @@ public unsafe partial struct EntityQuery
|
||||
|
||||
public readonly void Dispose()
|
||||
{
|
||||
_changedComponentIDs.Dispose();
|
||||
_scope.Dispose();
|
||||
}
|
||||
}
|
||||
@@ -1071,6 +1075,7 @@ public unsafe partial struct EntityQuery
|
||||
|
||||
public readonly void Dispose()
|
||||
{
|
||||
_changedComponentIDs.Dispose();
|
||||
_scope.Dispose();
|
||||
}
|
||||
}
|
||||
@@ -1320,6 +1325,7 @@ public unsafe partial struct EntityQuery
|
||||
|
||||
public readonly void Dispose()
|
||||
{
|
||||
_changedComponentIDs.Dispose();
|
||||
_scope.Dispose();
|
||||
}
|
||||
}
|
||||
@@ -1579,6 +1585,7 @@ public unsafe partial struct EntityQuery
|
||||
|
||||
public readonly void Dispose()
|
||||
{
|
||||
_changedComponentIDs.Dispose();
|
||||
_scope.Dispose();
|
||||
}
|
||||
}
|
||||
@@ -1848,6 +1855,7 @@ public unsafe partial struct EntityQuery
|
||||
|
||||
public readonly void Dispose()
|
||||
{
|
||||
_changedComponentIDs.Dispose();
|
||||
_scope.Dispose();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -198,6 +198,7 @@ public unsafe partial struct EntityQuery
|
||||
|
||||
public readonly void Dispose()
|
||||
{
|
||||
_changedComponentIDs.Dispose();
|
||||
_scope.Dispose();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using Ghost.Core;
|
||||
using Misaki.HighPerformance.Jobs;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Runtime.CompilerServices;
|
||||
|
||||
namespace Ghost.Entities;
|
||||
@@ -215,6 +216,19 @@ public partial class World : IDisposable, IEquatable<World>
|
||||
throw new InvalidOperationException($"Resource of type {typeof(T).FullName} has not been registered in the World.");
|
||||
}
|
||||
|
||||
public bool TryGetService<T>([MaybeNullWhen(false)]out T resource)
|
||||
where T : class
|
||||
{
|
||||
if (_services.TryGetValue(typeof(T), out var obj))
|
||||
{
|
||||
resource = (T)obj;
|
||||
return true;
|
||||
}
|
||||
|
||||
resource = null;
|
||||
return false;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Checks if a global resource exists.
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user