public sealed class GpuClusterResolveShading the visibility buffer: one indirect dispatch per material, over the tiles that material is actually in.
No guide page documents this yet — the page shows what the code says about itself.
Remarks
The second half of phase 5 of docs/plan/22-virtualized-geometry.md, and the reason improvement 2 is worth the bookkeeping. GpuVisibilityTiles bins the screen and this dispatches over one material's bin, so a material covering one per cent of the screen shades one per cent of the pixels — against a full-screen material-depth pass, which is what resolving into a GBuffer costs.
A variant per material, and the composition is the material's own. The key is VisibilityResolve with the material's Composition filling the same two slots ForwardPlus composes — so a material is one surface feature chain and one shading model whichever pass reaches it, which is what "a second entry contract, not a second material system" has to mean. What differs is one permutation: UseAnalyticGradients, because a compute stage has no quad to take derivatives from.
Every binding is filled by name, through the effect's own plan. The resolve's resources and the material's parameters go into one collection and EffectSetWriter writes the set from the variant's reflection — the same route MaterialRenderFeature takes, and for the same reason: what a composed shader's set contains is whatever the material's features brought, so a host that numbered the bindings would be numbering a layout it cannot see.
The dispatch is indirect and the host never learns the tile count. The binning pass wrote it into the argument triple this reads, so a material covering the whole screen and one covering none are the same command.
Fields and properties (17)
public EffectSystem? EffectsWhere the resolve variants are compiled. Null resolves nothing.
public ComputePipelineCache? PipelinesWhere the compute pipelines come from. Null resolves nothing.
public GpuClusterVisibility? VisibilityThe traversal whose clusters are being shaded. Null resolves nothing.
public GpuVisibilityTiles? TilesThe binning whose lists are being dispatched over. Null resolves nothing.
public MeshletPagePool? PagesThe page pool the geometry is read out of. Null resolves nothing.
public IReadOnlyList<ResolveMaterial> MaterialsWhich material each bin holds. Set by whoever registered the meshes.
public SceneConstants? SceneThe lights, the shadow atlas, the environment and the irradiance field: set 0.
public ViewConstants? ViewConstantsThe camera's constants: set 1.
public DescriptorSetHandle DrawSetThe per-draw set: set 3, which holds the unclustered light list and the probe scalars.
public DescriptorSetHandle TextureTableThe table every material's textures live in.
public bool ImageBasedLightingWhether the variants compile the environment ambient term in.
public bool IrradianceFieldWhether they read indirect diffuse from a field.
public bool SplitOutputsWhether the resolve splits its answer across three planes — the ambient split.
public int ResolvedMaterialsHow many materials the last Prepare resolved a variant for.
public int UnresolvedHow many were asked for and could not be.
public int DispatchesHow many dispatches the last Record issued.
public const string AnalyticGradientsKeyThe permutation that swaps implicit derivatives for supplied ones.
Methods (5)
public GpuClusterResolve(IGraphicsDevice device)Creates a resolve that dispatches on a device.
public static EffectKey Key(Material material, bool imageBasedLighting = true, bool irradianceField = false, bool splitOutputs = false)The effect key one material's resolve variant is compiled under.
public bool Prepare(RenderView view, TextureViewHandle target, TextureViewHandle identities, Int2 size, TextureViewHandle albedo = default(TextureViewHandle), TextureViewHandle normal = default(TextureViewHandle))Resolves a variant per material and writes the set each dispatch will bind.
public int Record(ICommandList list)Records one indirect dispatch per prepared material.
public void Dispose()Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
Used by (8)
- BinVixen.Rendering
- ClusterResolveTestsVixen.Rendering.Tests
- CompositorAssetTestsVixen.Rendering.Tests
- CompositorBuilderVixen.Rendering
- SceneRenderHostTestsVixen.Engine.Renderer.Tests
- VirtualGeometryContentTestsVixen.Rendering.Tests
- VirtualGeometrySystemVixen.Rendering
- VisibilityBufferRendererVixen.Rendering