forked from Misaki/GhostEngine
Refactor and enhance codebase for maintainability
Refactored and reorganized the codebase to improve readability, performance, and maintainability. Introduced new interfaces and structs for better resource management, updated project configuration files, and refactored shader and graphics pipeline management. Improved error handling, code formatting, and removed unused code and namespaces. Updated DLL references and method signatures for consistency and maintainability.
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using Ghost.Core;
|
||||
using Ghost.Graphics.RHI;
|
||||
using Misaki.HighPerformance.LowLevel.Buffer;
|
||||
using Misaki.HighPerformance.LowLevel.Collections;
|
||||
using Misaki.HighPerformance.LowLevel.Utilities;
|
||||
@@ -7,7 +8,7 @@ using Misaki.HighPerformance.Mathematics.Geometry;
|
||||
|
||||
namespace Ghost.Graphics.Data;
|
||||
|
||||
public struct Mesh : IHandleType
|
||||
public struct Mesh : IResourceReleasable, IHandleType
|
||||
{
|
||||
public UnsafeList<Vertex> vertices;
|
||||
public UnsafeList<uint> indices;
|
||||
@@ -38,6 +39,14 @@ public struct Mesh : IHandleType
|
||||
vertices.Dispose();
|
||||
indices.Dispose();
|
||||
}
|
||||
|
||||
void IResourceReleasable.ReleaseResource(IResourceDatabase database)
|
||||
{
|
||||
ReleaseCpuResources();
|
||||
|
||||
database.ReleaseResource(vertexBuffer.AsResource());
|
||||
database.ReleaseResource(indexBuffer.AsResource());
|
||||
}
|
||||
}
|
||||
|
||||
public static class MeshExtension
|
||||
|
||||
Reference in New Issue
Block a user