Refactor graphics engine dependencies and structure

Removed references to `Misaki.HighPerformance.Unsafe` and replaced them with `Misaki.HighPerformance.LowLevel` in multiple files.
Removed calls to `AllocationManager.Initialize()` and `AllocationManager.Dispose()` in `EngineCore.cs`.
Added new methods to the `ICommandBuffer` interface for enhanced rendering capabilities.
Updated the `D3D12CommandBuffer` class to implement new graphics command handling methods.
Added the `Material` class to manage shader properties and caching for improved performance.
Encapsulated shader compilation and reflection processes within the `Shader` class for better organization.
Added the `CBufferCache` struct to optimize GPU resource management for constant buffer data.
Updated the `MeshRenderPass` class to utilize the new `Material` class for dynamic mesh rendering.
Updated various project files to reflect the restructuring of dependencies.
Modified XAML files and code-behind for improved readability and maintainability.
This commit is contained in:
2025-07-07 22:59:47 +09:00
parent 261afa4133
commit eed1b9d3d0
24 changed files with 630 additions and 344 deletions

View File

@@ -5,7 +5,10 @@ namespace Ghost.Graphics.Contracts;
public interface ICommandBuffer
{
public void DrawMesh(Mesh mesh);
public void CopyResource(IResource dstResource, uint dstOffset, IResource srcResource, uint srcOffset, uint size);
// TODO: They should be internal, maybe an interface ICommandBufferInternal?
public void BarrierTransition(IResource resource, ResourceStates beforeState, ResourceStates afterState);
public void SetGraphicsRootConstantBufferView(uint slot, ulong gpuAddress);
public void DrawMesh(Mesh mesh, Material material);
public void CopyResource(IResource dstResource, uint dstOffset, IResource srcResource, uint srcOffset, uint size);
}

View File

@@ -1,6 +1,8 @@
namespace Ghost.Graphics.Contracts;
using Misaki.HighPerformance.LowLevel.Collections;
public interface IResource : IDisposable
namespace Ghost.Graphics.Contracts;
public unsafe interface IResource : IDisposable
{
public ulong GPUAddress
{
@@ -20,4 +22,17 @@ public interface IResource : IDisposable
public void SetData<T>(Span<T> data)
where T : unmanaged;
public void SetData<T>(T* data, uint length)
where T : unmanaged;
public void SetData(void* data, uint size);
public UnsafeArray<T> ReadData<T>(Allocator allocator)
where T : unmanaged;
public void ReadData<T>(T* ppData, uint* size)
where T : unmanaged;
public void ReadData(void* ppData, uint* size);
}