Vixen
dd8b0a81
csharp
public sealed class UiGeometryBuilder

Turns a frame's draw list into the vertices a renderer submits.

Read the guide page for this →

Remarks

The last step that is still the interface's own. Everything below here is a pipeline, a buffer and a scissor; everything above is elements and styles. Being a pure function of a draw list is what lets the whole of it be tested without a device — the same argument the draw list itself makes about being testable without a window.

⚠ Boxes are one quad each, not a tessellated outline. A rounded rectangle and its border are both a signed distance the shader evaluates per pixel, so a corner is exact at any radius and costs four vertices — where tessellating one costs a vertex count that grows with the radius and is still faceted. That is also why the two share a batch kind: one shader draws both, with the thickness deciding whether the inside is filled.

⚠ Clips are resolved here rather than replayed. A draw list pushes and pops; a renderer sets a scissor. Carrying the resolved rectangle on each draw means the renderer never holds a stack, and cannot be caught out by a batch it skipped having left one behind.

⚠ This is also where a colour is brought into what the surface can show — see Gamut. It is the last stage that is still the interface's own and the first that knows which surface the picture is for, which makes it the only place the repair can sit: above it the draw list is deliberately device-independent, and below it the colour is already inside a UNORM attachment that has truncated it.

Fields and properties (17)

  • public int CachedPaths

    How many distinct paths the tessellation cache is holding.

  • public IconAtlas? Icons

    The icons this builder has drawn from the atlas, or null before it has drawn any.

  • public int RefusedFields

    How many of the last frame's field paths the atlas could not take.

  • public int FieldPaths

    How many of the last frame's paths were drawn as four vertices from the atlas.

  • public int TessellatedPaths

    How many of the last frame's paths had to be tessellated rather than re-used.

  • public int CacheCapacity

    How many paths the cache keeps before it drops the ones this frame did not use.

  • public int DroppedGlyphs

    How many glyphs were dropped because the atlas could not hold them.

  • public bool AtlasChanged

    Whether the atlas changed while this frame's quads were being emitted.

  • public float Tolerance

    How far a flattened curve may sit from the curve it replaces, in document pixels.

  • public float Fringe

    How far a path's antialiasing fringe reaches past its outline, in document pixels.

  • public ColorGamut Gamut

    What the surface these vertices are for can show.

  • public float WhiteLevel

    What the interface's white is worth in the units the target is drawn in.

  • public int MappedColours

    How many of the last frame's colours were outside Gamut and repaired.

  • public int ColourSearches

    How many of those repairs had to run the binary search rather than be remembered.

  • public (int Version, Rectangle Extent) Built

    The draw-list version and extent the geometry this builder holds was made from.

  • public int Tessellations

    How many frames this builder has actually tessellated.

  • public int TessellationsSkipped

    How many frames were answered with the vertices this builder already had.

Methods (3)

Used by (24)

  • FillRuleTestsVixen.Ui.Testing.Tests
  • GroupOpacityTestsVixen.Ui.Controls.Tests
  • HudLuminanceDeviceTestsVixen.Graphics.Golden.Tests
  • HudLuminanceTestsVixen.Ui.Controls.Tests
  • IconAtlasTestsVixen.Ui.Tests
  • IdleFrameWorkTestsVixen.Ui.Tests
  • InterfaceInAWorldTestsVixen.Engine.Renderer.Tests
  • MixBlendModeLuminanceTestsVixen.Ui.Controls.Tests
  • NineSliceImageTestsVixen.Ui.Tests
  • PathTessellationCacheTestsVixen.Ui.Tests
  • UiBoxAgreementTestsVixen.Graphics.Golden.Tests
  • UiCompositingTestsVixen.Graphics.Golden.Tests
  • UiFrameLifetimeTestsVixen.Graphics.Golden.Tests
  • UiGamutTestsVixen.Ui.Tests
  • UiGeometryTestsVixen.Ui.Tests
  • UiImageTestsVixen.Graphics.Golden.Tests
  • UiImageViewTestsVixen.Graphics.Golden.Tests
  • UiRavenAgreementTestsVixen.Graphics.Golden.Tests
  • UiTestVixen.Ui.Testing
  • UiTransformProjectiveTestsVixen.Ui.Tests
  • UiWindowSurfaceVixen.Ui.Desktop
  • VideoInUiTestsVixen.Video.Rendering.Tests
  • EditorUiCompositingDeviceTestsVixen.Editor.App.Tests
  • ThumbnailSurfaceDeviceTestsVixen.Editor.App.Tests