- Added new C# formatting rules in .editorconfig. - Introduced `IKeyType`, `Key<T>`, and `Ptr<T>` structs. - Updated `Result` and `Result<T>` for implicit conversions. - Added AOT compatibility to project files. - Introduced a `Camera` class and refactored namespaces. - Enhanced rendering with bindless support and pipeline state management. - Refactored `D3D12CommandBuffer` for new rendering features. - Improved `D3D12PipelineLibrary` with disk caching methods. - Added support for UAVs and raw buffers in `D3D12ResourceAllocator`. - Improved shader compilation and reflection in `D3D12ShaderCompiler`. - Refactored descriptor heap and swap chain initialization. - Added enums and structs for rendering configurations. - Expanded `ICommandBuffer` and `IPipelineLibrary` interfaces. - Updated `MeshRenderPass` to align with the new pipeline. - Consolidated namespaces and improved code maintainability.
31 lines
933 B
C#
31 lines
933 B
C#
using Ghost.Core;
|
|
|
|
namespace Ghost.Graphics.Core;
|
|
|
|
public readonly struct GPUResource : IHandleType;
|
|
public readonly struct Texture : IHandleType;
|
|
public readonly struct GraphicsBuffer : IHandleType;
|
|
|
|
public static class ResourceHandleExtensions
|
|
{
|
|
public static Handle<GPUResource> AsResource(this Handle<Texture> texture)
|
|
{
|
|
return new Handle<GPUResource>(texture.id, texture.generation);
|
|
}
|
|
|
|
public static Handle<GPUResource> AsResource(this Handle<GraphicsBuffer> buffer)
|
|
{
|
|
return new Handle<GPUResource>(buffer.id, buffer.generation);
|
|
}
|
|
|
|
internal static Handle<Texture> AsTexture(this Handle<GPUResource> resource)
|
|
{
|
|
return new Handle<Texture>(resource.id, resource.generation);
|
|
}
|
|
|
|
internal static Handle<GraphicsBuffer> AsGraphicsBuffer(this Handle<GPUResource> resource)
|
|
{
|
|
return new Handle<GraphicsBuffer>(resource.id, resource.generation);
|
|
}
|
|
}
|