Vixen
02b45cc4
csharp
public sealed class ScreenProbeHistoryTexture

The screen probes' accumulated history, on the device — two sets of planes, ping-ponged.

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

Remarks

Six planes per set. Four carry the accumulated projection in ScreenProbeResolve's own packing, so whatever upsamples resolved probes upsamples accumulated ones without knowing the difference. The fifth holds each probe's surface position with the accumulated weight in alpha, and the sixth its normal — what reprojection tests a surface against, and what tells "no history" from "history worth nothing".

Two sets, because accumulation reads last frame while writing this one. The dispatch reads the front set and writes the back; Swap then makes the back the front. One set read and written at once would race a panning camera against itself — the same reason ScreenProbeHistory double-buffers on the CPU.

⚠ Not graph resources — named into descriptor sets, so whoever dispatches into a set brackets it with TransitionBack and consumers find every plane in ShaderRead between dispatches.

Fields and properties (5)

  • public const int Planes

    Planes per set.

  • public const int FilteredPlanes

    Planes in the filtered set — the four the upsample reads.

  • public ScreenProbeLayout Layout

    The lattice the history covers.

  • public bool IsCreated

    Whether the device objects exist yet.

  • public TextureDescription PlaneDescription

    What one plane is, for a graph import.

Methods (17)

  • public ScreenProbeHistoryTexture(ScreenProbeLayout layout)

    Builds a history over one lattice. Nothing exists until EnsureCreated.

  • public TextureViewHandle FrontView(int plane)

    The set the last accumulation wrote — what a consumer reads.

  • public TextureHandle FrontTexture(int plane)

    The front set's texture, for importing into a graph.

  • public TextureViewHandle BackView(int plane)

    The set the next accumulation writes.

  • public TextureHandle BackTexture(int plane)

    The back set's texture — what a graph imports for passes that run after the swap.

  • public void Swap()

    Makes the back set the front — the written history becomes the read one.

  • public TextureViewHandle FilteredView(int plane)

    One plane of the spatially filtered probes — what the upsample reads when a filter runs.

  • public TextureHandle FilteredTexture(int plane)

    The filtered plane's texture, for importing into a graph.

  • public void TransitionFiltered(ICommandList commands, ResourceState before, ResourceState after)

    Moves the filtered set between ShaderRead and writable.

  • public void EnsureCreated(IGraphicsDevice graphics)

    Creates both sets, without recording anything — a graph import needs handles at build time.

  • public void Prime(ICommandList commands)

    Puts every plane of both sets in ShaderRead, once.

  • public void TransitionBack(ICommandList commands, ResourceState before, ResourceState after)

    Moves the back set between ShaderRead and writable.

  • public bool RecordReadback(ICommandList commands)

    Records a copy of the front set back into host memory.

  • public bool RecordFilteredReadback(ICommandList commands)

    Records a copy of the filtered planes back into host memory.

  • public bool TryReadFiltered(Span<SphericalHarmonicsL1> filteredProbes)

    Decodes what the last RecordFilteredReadback copied.

  • public bool TryRead(Span<SphericalHarmonicsL1> accumulated, Span<float> weights)

    Decodes what the last RecordReadback copied.

  • public void Dispose()

    Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

Used by (4)

  • ScreenProbeAccumulateDeviceTestsVixen.Graphics.Golden.Tests
  • ScreenProbeAccumulateFillVixen.Rendering
  • ScreenProbeFilterFillVixen.Rendering
  • ScreenProbeGatherRendererVixen.Rendering.PostFx