using Ghost.Core;
using Ghost.Core.Graphics;
using Misaki.HighPerformance.LowLevel.Collections;
using Ghost.Graphics.Core;
namespace Ghost.Graphics.RHI;
public interface IResourceAllocator : IDisposable
{
///
/// Creates a texture resource
///
/// Texture description
/// An point to the resource
Handle CreateTexture(ref readonly TextureDesc desc, bool tempResource = false);
///
/// Creates a render Target for off-screen rendering
///
/// Render Target description
/// An point to the resource
Handle CreateRenderTarget(ref readonly RenderTargetDesc desc, bool tempResource = false);
///
/// Creates a buffer resource
///
/// Buffer description
/// An point to the resource
Handle CreateBuffer(ref readonly BufferDesc desc, bool tempResource = false);
///
/// Creates a new sampler object using the specified sampler description.
///
/// A read-only reference to a structure that defines the properties of the sampler to be created.
/// An that uniquely identifies the created sampler object.
Identifier CreateSampler(ref readonly SamplerDesc desc);
///
/// 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.
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.
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.
Identifier CreateGraphicsShader(ShaderDescriptor descriptor);
}