using Ghost.Core; using Ghost.Core.Graphics; using Misaki.HighPerformance.LowLevel.Collections; using Ghost.Graphics.Core; namespace Ghost.Graphics.RHI; public interface IResourceAllocator { /// /// Creates a texture resource /// /// Texture description /// A new texture handle point to the resource public Handle CreateTexture(ref readonly TextureDesc desc, bool tempResource = false); /// /// Creates a render target for off-screen rendering /// /// Render target description /// A new texture handle point to the resource public Handle CreateRenderTarget(ref readonly RenderTargetDesc desc, bool tempResource = false); /// /// Creates a buffer resource /// /// Buffer description /// A new buffer handle point to the resource public Handle CreateBuffer(ref readonly BufferDesc desc, bool tempResource = false); /// /// Creates a new mesh from the specified vertex and index data. /// /// A UnsafeList containing the vertices that define the geometry of the mesh. Must contain at least one vertex. /// A UnsafeList containing the indices that specify how vertices are connected to form primitives. Must contain at least one index. /// An representing the newly created mesh. public Handle CreateMesh(UnsafeList vertices, UnsafeList indices); /// /// Creates a new material instance using the specified shader. /// /// The identifier of the shader to associate with the new material. Cannot be null. /// An representing the newly created material. public Handle CreateMaterial(Identifier shader); /// /// Creates a new shader and returns its unique identifier. /// /// An representing the newly created shader. /// The viewGroup containing the shader's properties and passes. public Identifier CreateShader(ShaderDescriptor descriptor); }