Vixen
02b45cc4
csharp
public readonly record struct UiVertex

One vertex of the interface, in the layout both UI shaders read.

No guide page documents this yet — the page shows what the code says about itself.

Remarks

⚠ One layout for both, rather than one per shader. Two layouts would mean two vertex buffers, two uploads and two places for a batch to point at, to save sixteen bytes on a vertex count that is in the thousands rather than the millions — an interface is not a mesh. What it buys is that a frame is one buffer and one copy however many kinds of thing it draws.

Fields a kind does not use are zero, exactly as DrawCommand does it, and for the same reason: the consumer switches on the batch anyway.

Fields and properties (4)

  • public Vector2 Position

    Where it is, in document pixels.

  • public Vector2 Texture

    An atlas coordinate for text, and the offset from the shape's centre for everything else.

  • public Color4 Color

    Its colour, in linear space.

  • public Vector4 Shape

    What the shader needs beyond the position: for a box, the index of its record in Shapes; for a glyph, the screen-pixel range; for a path triangle, how much of the pixel the shape covers there. Only the first lane is ever read.

Methods (1)

  • public UiVertex(Vector2 Position, Vector2 Texture, Color4 Color, Vector4 Shape)

    One vertex of the interface, in the layout both UI shaders read.

Used by (8)

  • IconAtlasTestsVixen.Ui.Tests
  • NineSliceImageTestsVixen.Ui.Tests
  • PathTessellationCacheTestsVixen.Ui.Tests
  • SoftwareUiRasterizerVixen.Ui.Testing
  • UiGeometryVixen.Ui
  • UiGeometryBuilderVixen.Ui
  • UiGeometryTestsVixen.Ui.Tests
  • UiRendererVixen.Ui.Renderer