Render extraction system & ECS/graphics refactor
Introduced RenderExtractionSystem for entity-based render data extraction. Added MeshInstance and MeshPalette components with shadow casting support. Refactored QueryBuilder API, SharedComponentStore, and component registration for clarity and flexibility. Updated SystemManager and SystemGroup to use SystemAPI. Replaced RenderingConfig with GraphicsEngineDesc/RenderSystemDesc. RenderFrame now uses CPU/GPU fence values for sync. Removed Camera.cs in favor of ECS-based rendering. Improved Material, RenderingLayerMask, Mesh, and RenderList APIs. Updated package references and fixed naming, error handling, and disposal issues.
This commit is contained in:
@@ -95,8 +95,6 @@ public interface ICommandBuffer : IDisposable
|
||||
/// </summary>
|
||||
void EndRenderPass();
|
||||
|
||||
// TODO: Enhanced barriers.
|
||||
|
||||
/// <summary>
|
||||
/// Inserts multiple resource barriers.
|
||||
/// </summary>
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
using Misaki.HighPerformance.Mathematics;
|
||||
|
||||
namespace Ghost.Graphics.RHI;
|
||||
|
||||
public interface IFenceSynchronizer
|
||||
|
||||
@@ -2,6 +2,14 @@ using Ghost.Core;
|
||||
|
||||
namespace Ghost.Graphics.RHI;
|
||||
|
||||
public readonly struct GraphicsEngineDesc
|
||||
{
|
||||
public uint FrameBufferCount
|
||||
{
|
||||
get; init;
|
||||
}
|
||||
}
|
||||
|
||||
public interface IGraphicsEngine : IDisposable
|
||||
{
|
||||
IRenderDevice Device
|
||||
@@ -73,6 +81,8 @@ public interface IGraphicsEngine : IDisposable
|
||||
/// Renders the current frame.
|
||||
/// </summary>
|
||||
/// <param name="commandAllocator">Command allocator to use for rendering</param>
|
||||
/// <param name="cpuFenceValue">CPU fence value for synchronization</param>
|
||||
/// <param name="gpuFenceValue">GPU fence value for synchronization</param>
|
||||
/// <returns>Result of the rendering operation</returns>
|
||||
Result RenderFrame(ICommandAllocator commandAllocator);
|
||||
Result RenderFrame(ICommandAllocator commandAllocator, uint cpuFenceValue, uint gpuFenceValue);
|
||||
}
|
||||
|
||||
@@ -7,6 +7,8 @@ public readonly struct RenderContext
|
||||
public ICommandBuffer CommandBuffer { get; init; }
|
||||
}
|
||||
|
||||
// TODO: We may don't need this anymore. We Use RenderExtractionSystem to extract render data from entities and pass them to IRenderPipeline to render.
|
||||
|
||||
/// <summary>
|
||||
/// High-level renderer interface that uses RHI abstractions
|
||||
/// </summary>
|
||||
@@ -34,4 +36,4 @@ public interface IRenderer : IDisposable
|
||||
/// <param name="commandAllocator">Command allocator to use for rendering</param>
|
||||
/// <returns>Result of the rendering operation</returns>
|
||||
Result Render(ICommandAllocator commandAllocator);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -33,7 +33,6 @@ public enum BindlessAccess
|
||||
|
||||
// TODO: Consider adding methods for resource enumeration, statistics, and bulk operations.
|
||||
// TODO: Consider adding async resource loading and streaming support.
|
||||
// TODO: Mesh, Material, Shader management could be separated into their own interfaces for better modularity because they are not bound to specific graphics API.
|
||||
public interface IResourceDatabase : IDisposable
|
||||
{
|
||||
/*
|
||||
@@ -114,7 +113,7 @@ public interface IResourceDatabase : IDisposable
|
||||
/// <param name="id">An integer identifier to associate with the sampler.</param>
|
||||
/// <returns>An <see cref="Identifier{Sampler}"/> representing the sampler that matches the specified description.
|
||||
/// If a matching sampler does not exist, a new sampler is created and its identifier is returned.</returns>
|
||||
Identifier<Sampler> CreateSampler(ref readonly SamplerDesc desc, int id);
|
||||
Identifier<Sampler> AddSampler(ref readonly SamplerDesc desc, int id);
|
||||
|
||||
/// <summary>
|
||||
/// Determines whether a sampler with the specified identifier exists.
|
||||
|
||||
Reference in New Issue
Block a user