Refactor render graph & DSL; remove material system
- Major optimization of Ghost.RenderGraph.Concept: pooled resources, zero-allocation hot paths, explicit queue types, and batch barrier APIs. - Migrated Ghost.DSL shader compiler to ANTLR4-based parser; removed hand-written parser, added grammar files and semantic model conversion. - Added CollectionPool/ListPool for pooled list management. - Updated documentation for new architecture and performance. - Removed Ghost.Shader.Concept (material/material system) from repo and solution. - README.md replaced with a brief project statement.
This commit is contained in:
22
Ghost.Core/Utilities/CollectionPool.cs
Normal file
22
Ghost.Core/Utilities/CollectionPool.cs
Normal file
@@ -0,0 +1,22 @@
|
||||
using Misaki.HighPerformance.Buffer;
|
||||
|
||||
namespace Ghost.Core.Utilities;
|
||||
|
||||
public class CollectionPool<TCollection, TItem>
|
||||
where TCollection : class, ICollection<TItem>, new()
|
||||
{
|
||||
internal static readonly ObjectPool<TCollection> s_pool = new ObjectPool<TCollection>(() => new TCollection(), 1);
|
||||
|
||||
public static TCollection Rent()
|
||||
{
|
||||
return s_pool.Rent();
|
||||
}
|
||||
|
||||
public static void Return(TCollection collection)
|
||||
{
|
||||
collection.Clear();
|
||||
s_pool.Return(collection);
|
||||
}
|
||||
}
|
||||
|
||||
public class ListPool<T> : CollectionPool<List<T>, T>;
|
||||
Reference in New Issue
Block a user