forked from Misaki/GhostEngine
Enhanced shader and resource systems with `Sampler` support, including updates to `ShaderPropertyType`, HLSL code, and resource management. Refactored `Result` structs for better type safety and added new enums for texture and comparison settings. Improved `MeshRenderPass` to dynamically load textures and samplers. Updated SDL compiler and token lexicon for `Sampler` handling. Embedded debug info in project files and streamlined resource state tracking.
33 lines
981 B
C#
33 lines
981 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 readonly struct Sampler : IIdentifierType;
|
|
|
|
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);
|
|
}
|
|
}
|