Vixen
02b45cc4
csharp
public sealed class GpuCullingRenderer

Runs the culling dispatch and the argument pass inside the frame, so neither answer has to come back to the host.

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

Remarks

The node that makes ReadBack false a usable setting. With no readback there is no wait, and the only ordering this RHI can express without a fence or a semaphore is a barrier between two things in the same queue — so the dispatch has to be recorded where the draws that consume it are recorded. That is what this does, at the head of the frame: cull, then turn the bits into draw arguments, then let every later pass draw from them.

The templates are filled here rather than in a feature's Prepare. A root feature's Prepare runs before its sub-features', so an instancing batch's size and first instance are not known yet when it runs — and those are two of the five numbers a record holds. A compositor node's Build runs after the whole of Draw, which is the first moment they all exist.

It declares no graph resources and is therefore a side effect: what it writes are two buffers that outlive the graph, and what reads them is a draw call rather than a pass.

Two-phase culling is two of these nodes. A second one with Phase set to Late, placed after the main pass's draws and after the HiZRenderer that reduced them, asks again about everything the first rejected — this time against depth from this frame rather than the last. Its answer goes into the same two buffers, which is why the draws that follow it need no knowledge of any of this: they read the same argument buffer, whose contents by then are the difference.

Fields and properties (3)

  • public GpuVisibilityGroup? Visibility

    The group whose dispatch to record. Null does nothing at all.

  • public GpuDrawArguments? Arguments

    Where the draw arguments go. Null records the cull and stops there.

  • public CullPhase Phase

    Which of a two-phase cull's dispatches this node records.

Methods (1)

Used by (3)

  • CompositorAssetTestsVixen.Rendering.Tests
  • CompositorBuilderVixen.Rendering
  • GpuVisibilityGroupTestsVixen.Rendering.Tests