small backup

This commit is contained in:
2026-01-13 14:50:55 +09:00
parent 02df8d7732
commit ac36bbf8c7
9 changed files with 1522 additions and 61 deletions

View File

@@ -3,11 +3,11 @@ using System.Runtime.CompilerServices;
namespace Ghost.RenderGraph.Concept;
internal enum RenderGraphResourceType
internal enum RenderGraphResourceType : int
{
Texture,
Buffer,
AccelerationStructure,
// AccelerationStructure,
Count
}
@@ -84,14 +84,79 @@ public readonly struct TextureDescriptor : IEquatable<TextureDescriptor>
this.name = name;
}
public readonly bool Equals(TextureDescriptor other) =>
width == other.width &&
public readonly bool Equals(TextureDescriptor other)
{
return width == other.width &&
height == other.height &&
format == other.format &&
name == other.name;
}
public override readonly bool Equals(object? obj) => obj is TextureDescriptor other && Equals(other);
public override readonly int GetHashCode() => HashCode.Combine(width, height, format, name);
public static bool operator ==(TextureDescriptor left, TextureDescriptor right)
{
return left.Equals(right);
}
public static bool operator !=(TextureDescriptor left, TextureDescriptor right)
{
return !(left == right);
}
}
[Flags]
public enum BufferUsage
{
None = 0,
Vertex = 1 << 0,
Index = 1 << 1,
IndirectArgument = 1 << 7,
Constant = 1 << 2,
ShaderResource = 1 << 3,
UnorderedAccess = 1 << 4,
Structured = 1 << 5,
Raw = 1 << 6,
Upload = 1 << 8,
Readback = 1 << 9,
}
public readonly struct BufferDescriptor : IEquatable<BufferDescriptor>
{
public readonly uint sizeInBytes;
public readonly uint stride;
public readonly BufferUsage usage;
public readonly string name;
public BufferDescriptor(uint sizeInBytes, uint stride, BufferUsage usage, string name)
{
this.sizeInBytes = sizeInBytes;
this.stride = stride;
this.usage = usage;
this.name = name;
}
public readonly bool Equals(BufferDescriptor other)
{
return sizeInBytes == other.sizeInBytes &&
stride == other.stride &&
usage == other.usage &&
name == other.name;
}
public override readonly bool Equals(object? obj) => obj is BufferDescriptor other && Equals(other);
public override readonly int GetHashCode() => HashCode.Combine(sizeInBytes, name);
public static bool operator ==(BufferDescriptor left, BufferDescriptor right)
{
return left.Equals(right);
}
public static bool operator !=(BufferDescriptor left, BufferDescriptor right)
{
return !(left == right);
}
}
/// <summary>