Vixen
02b45cc4
csharp
public sealed class EffectSystem

Resolves an EffectKey to a compiled Effect, remembering what it already resolved.

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

Remarks

The in-memory tier of the three [docs/plan/06 § Effect permutations] describes. The other two are providers: an on-disk bytecode cache and, before it, the bundle the content build baked. This class does not know which it has — it asks each in turn and remembers the answer.

A miss is reported, not hidden. MissCount and Misses exist so that "no runtime shader compilation in a shipping build" can be a test rather than a hope, which is what doc 06's testing table asks for: run a playthrough, assert the miss list is empty.

Fields and properties (7)

  • public int Count

    How many distinct effects are in memory.

  • public int MissCount

    How many distinct keys no provider could satisfy.

  • public IEnumerable<EffectKey> Misses

    The keys no provider could satisfy, for a shipping-build assertion.

  • public IEnumerable<EffectKey> Requests

    Every distinct key anything has asked for, hit or miss.

  • public int RequestCount

    How many distinct keys have been asked for.

  • public Effect? Placeholder

    What to draw with while a variant is being produced, or null to wait for it.

  • public int PendingCount

    How many keys are waiting to be produced.

Methods (8)

  • public void AddProvider(IEffectProvider provider)

    Adds a provider. Providers are asked in the order they were added.

  • public void Add(Effect effect)

    Puts an effect in memory directly, bypassing the providers.

  • public Effect? Resolve(EffectKey key)

    The effect for a key, asking each provider in turn if it is not already in memory.

  • public int Pump(int limit = 2147483647)

    Produces some of what is waiting, and answers how many arrived.

  • public bool TryResolve(EffectKey key, out Effect? effect)

    The effect for a key, or false when nothing could supply it.

  • public void Invalidate()

    Forgets every resolved effect and every recorded miss.

  • public void ClearRequests()

    Forgets what has been asked for, without forgetting anything resolved.

  • public bool Invalidate(EffectKey key)

    Forgets one effect, for a reload that knows what changed.

Used by (99, showing 40)

  • ArenaThirdPersonShooter
  • ArenaIlluminationThirdPersonShooter
  • DevelopmentEffectsThirdPersonShooter
  • VirtualGeometryGameVirtualGeometry
  • AccelerationStructureDeviceTestsVixen.Graphics.Golden.Tests
  • AppGraphicsVixen.App.Hosting
  • AutoExposureTestsVixen.Rendering.PostFx.Tests
  • BindlessFrameTestsVixen.Rendering.Tests
  • BloomTestsVixen.Rendering.PostFx.Tests
  • BufferTransferDeviceTestsVixen.Graphics.Golden.Tests
  • BufferTransferTestsVixen.Rendering.Tests
  • ClusterCullingDeviceTestsVixen.Graphics.Golden.Tests
  • ClusterResolveTestsVixen.Rendering.Tests
  • ClusteredLightingTestsVixen.Rendering.Tests
  • ClusteredShadingDeviceTestsVixen.Graphics.Golden.Tests
  • CompositorAssetTestsVixen.Rendering.Tests
  • CompositorBuilderVixen.Rendering
  • CompositorFrameVixen.Rendering
  • CompositorImageTestsVixen.Graphics.Golden.Tests
  • ComputeRendererVixen.Rendering
  • DepthPrepassTestsVixen.Rendering.Tests
  • DescriptorBindingTestsVixen.Rendering.Tests
  • DistanceFieldAoImageTestsVixen.Graphics.Golden.Tests
  • DrawCompactionTestsVixen.Rendering.Tests
  • EffectCacheTestsVixen.Shaders.Tests
  • EffectSystemTestsVixen.Shaders.Tests
  • ForwardFrameTestsVixen.Rendering.Tests
  • ForwardLightingTestsVixen.Rendering.Tests
  • FullScreenRendererVixen.Rendering
  • GlobalDistanceFieldRendererTestsVixen.Rendering.Tests
  • GpuClusterRasterVixen.Rendering
  • GpuClusterResolveVixen.Rendering
  • GpuClusterSoftwareRasterVixen.Rendering
  • GpuClusterVisibilityVixen.Rendering
  • GpuDrawArgumentsVixen.Rendering
  • GpuDrivenCompositorTestsVixen.Rendering.Tests
  • GpuVisibilityGroupVixen.Rendering
  • GpuVisibilityGroupTestsVixen.Rendering.Tests
  • GpuVisibilityTilesVixen.Rendering
  • GraphicsCompositorVixen.Rendering