Refactor and optimize rendering pipeline

- Added `<IsTrimmable>` property in project files for trimming.
- Replaced bindless texture types with non-bindless equivalents.
- Refactored `ShaderDescriptor` and `ShaderPass` for better modularity.
- Introduced `ShaderDescriptorExtensions` for property size calculations.
- Simplified constant buffer handling in `Material.cs`.
- Improved resource management in `D3D12` components.
- Added support for static meshes and optimized resource barriers.
- Refactored shader code generation and property merging in `SDLCompiler`.
- Removed unused or redundant code (e.g., `IncludesBlock` parser).
- Updated comments, documentation, and error handling for clarity.
This commit is contained in:
2025-11-28 18:58:50 +09:00
parent 0720444c2c
commit bd97d233cb
49 changed files with 842 additions and 1025 deletions

View File

@@ -11,6 +11,9 @@ namespace Ghost.Graphics.Core;
public struct Mesh : IResourceReleasable, IHandleType
{
private UnsafeList<Vertex> _vertices;
private UnsafeList<uint> _indices;
internal bool IsMeshDataDirty
{
get; private set;
@@ -21,10 +24,10 @@ public struct Mesh : IResourceReleasable, IHandleType
/// </summary>
public UnsafeList<Vertex> Vertices
{
readonly get => field;
readonly get => _vertices;
set
{
field = value;
_vertices = value;
VertexCount = value.Count;
IsMeshDataDirty = true;
}
@@ -35,10 +38,10 @@ public struct Mesh : IResourceReleasable, IHandleType
/// </summary>
public UnsafeList<uint> Indices
{
readonly get => field;
readonly get => _indices;
set
{
field = value;
_indices = value;
IndexCount = value.Count;
IsMeshDataDirty = true;
}
@@ -100,8 +103,8 @@ public struct Mesh : IResourceReleasable, IHandleType
internal Mesh(ReadOnlySpan<Vertex> vertices, ReadOnlySpan<uint> indices, Handle<GraphicsBuffer> vertexBuffer, Handle<GraphicsBuffer> indexBuffer)
{
Vertices = new(vertices.Length, Allocator.Persistent);
Indices = new(indices.Length, Allocator.Persistent);
Vertices = new UnsafeList<Vertex>(vertices.Length, Allocator.Persistent);
Indices = new UnsafeList<uint>(indices.Length, Allocator.Persistent);
Vertices.CopyFrom(vertices);
Indices.CopyFrom(indices);
VertexBuffer = vertexBuffer;
@@ -112,8 +115,8 @@ public struct Mesh : IResourceReleasable, IHandleType
public readonly void ReleaseCpuResources()
{
Vertices.Dispose();
Indices.Dispose();
_vertices.Dispose();
_indices.Dispose();
}
void IResourceReleasable.ReleaseResource(IResourceDatabase database)