Map your types to the GPU#
Vector mapping uses YotsubaShader.Language.Native.Types.Vector. Mark the type with [Vector] and its ordered components with [VectorComponent(index)]. Components must share a supported scalar type.
using YotsubaShader.Language.Native.Types.Vector;
[Vector]
public struct Float2
{
[VectorComponent(0)] public float X;
[VectorComponent(1)] public float Y;
public Float2(float x, float y) { X = x; Y = y; }
}
A name such as Vector2 does not provide native vector semantics. You can annotate types you own; an unchanged third-party assembly cannot acquire these attributes through a using directive. Unannotated structs are inspected as fields and properties.
Sharing libraries#
You can distribute C# types and shader source through NuGet. GPU compilation of arbitrary library methods is not implemented: shader discovery only searches the current assembly, and invocation processing is unfinished. Packaging code does not establish GPU compatibility.
