Vixen
02b45cc4
csharp
public sealed class UiRenderFeature

Draws user interfaces inside somebody else's renderer.

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

Remarks

A thin adapter, deliberately. Everything that touches a device is in UiRenderer, which a golden image can drive directly; this is what makes one of those reachable from a RenderSystem — and the split is why the shaders can be checked against a picture without a scene, a camera or a compositor.

⚠ One render object per surface, not one per batch — which corrects a guess written down before the renderer had been read. DrawBatch's remarks reasoned that RenderSortMode.ByGroup exists "for UI and anything else already ordered", and concluded that the batch index would have to be the sort group. It is not, and it cannot be: the store's objects live across frames and are indexed by a dense id every feature's parallel array is keyed on, so an object per batch would churn the whole store every time a label changed. The painting order within a surface is already the order of UiGeometry.Draws, and no sort can reach it. What the group orders is surfaces against each other — a modal over a document, a tooltip over the modal — which is a real ordering problem that a sort is the right answer to.

So the batch list was not a wasted guess and is not the thing to delete: it is what UiGeometryBuilder turns into one UiDraw each, behind the frame diff, so a still interface regroups nothing. That was the open question and this is its answer.

Fields and properties (2)

  • public override string Name

    The feature's name, for logging and profiling.

  • public UiRenderer? Renderer

    What actually draws. Set before the first frame that draws.

Methods (4)