public static class GpuCullingThe records, the dispatch shape and the test that Raven/Library/Pipeline/Culling.rvn and the host have to agree about.
No guide page documents this yet — the page shows what the code says about itself.
Remarks
Everything here is duplicated from the shader, and — as with ClusterGrid — that is not a smell to be refactored away. The host packs bytes the shader reads as structs, so the two sides agree by construction or not at all, and a copy that can be evaluated on the CPU is what lets a test say they do without a GPU in the room.
IsVisible is the mirror, and it is the interesting one. It is a transliteration of the shader's Visible, so a randomised comparison against VisibilityGroup — which is the definition — says whether the arithmetic the device will run is the arithmetic the engine means. What it cannot say is whether the shader still contains that arithmetic; that is what the source assertion in GpuVisibilityGroupTests is for.
Fields and properties (14)
public const string ShaderNameThe shader's name, and the effect key the group resolves.
public const int WordSizeHow many objects one word of the device's answer holds.
public const int WordsPerInvocationHow many words one invocation owns, and therefore how many it writes.
public const int WorkgroupSizeThe workgroup size the culling shader declares.
public const uint AliveThe bit of Flags that says the slot holds a live object.
public const uint NoBonesWhat FirstBone holds when an instance is not skinned.
public const uint OccludersThe bit of Flags that says the view can be occlusion tested.
public const float ClipEpsilonWhat a clip-space w has to exceed to be in front of the camera at all.
public static uint[] SetBindingsEvery storage-buffer binding of the culling set, whichever variant is being dispatched.
public const string ReduceShaderNameThe name of the shader that builds the depth pyramid.
public const string ArgumentsShaderNameThe name of the shader that turns the bits into indirect draw arguments.
public static string OcclusionKeyThe permutation key selecting the variant that tests against that pyramid.
public static string LateKeyThe permutation key selecting the second pass of a two-phase cull.
public const int ReduceWorkgroupSizeThe workgroup size the reduction shader declares, in each of its two dimensions.
Methods (17)
public static bool IsSupported(IGraphicsDevice device)Whether a device can run any of this at all.
public static EffectKey Key(bool occlusion, CullPhase phase = Main)The effect key for one phase of the cull.
public static int WordsFor(int objectCount)How many device words a store of this many objects needs.
public static int Groups(int wordCount)How many workgroups cover one view's words.
public static long BufferSize(int viewCount, int wordCount)How many bytes a frame's answer occupies.
public static CullObject Pack(in RenderObject candidate)One object as the shader reads it.
public static CullView Pack(RenderView view, int objectCount, int wordCount, Matrix4x4 occluderProjection = default(Matrix4x4), int occluderLevels = 0)One view as the shader reads it.
public static bool IsVisible(in CullObject candidate, in CullView view)Whether the shader would set this object's bit for this view.
public static bool Outside(Vector4 plane, Vector3 center, float radius)Whether a sphere is entirely on the outer side of a plane, within the rounding slack.
public static bool ScreenBounds(in CullObject candidate, in CullView view, out Vector3 minimum, out Vector3 maximum)The screen rectangle and the nearest depth of an object, as the occlusion test projects them.
public static bool ScreenBounds(Vector3 center, float radius, in CullView view, out Vector3 minimum, out Vector3 maximum)The same, of any sphere.
public static int LevelFor(Vector2 extent, int levels)Which pyramid level a rectangle of this many level-0 texels is covered by.
public static Int2 LevelSize(Int2 size, int level)The size of one level of a pyramid whose level 0 is .
public static bool IsOccluded(in CullObject candidate, in CullView view, Int2 size, GpuCulling.OccluderDepth depth)Whether the shader would decide that last frame's depth hid this object entirely.
public static bool IsOccluded(Vector3 center, float radius, in CullView view, Int2 size, GpuCulling.OccluderDepth depth)The same, of any sphere — what the cluster traversal asks.
public static bool IsLate(in CullObject candidate, in CullView view, bool drawn, Int2 size, GpuCulling.OccluderDepth depth)Whether the late pass would set this object's bit, given what the main pass decided about it.
public static void Unpack(ReadOnlySpan<uint> words, Span<ulong> destination)Reassembles one view's device words into the host's 64-bit bitset.
Used by (24)
- AlwaysCompilesVixen.Rendering.Tests
- AlwaysCompilesVixen.Rendering.Tests
- ClusterAttributesVixen.Rendering
- ClusterRasterTestsVixen.Rendering.Tests
- ClusterResolveTestsVixen.Rendering.Tests
- ClusterRoutingTestsVixen.Rendering.Tests
- ClusterTraversalAcceptsTestsVixen.Rendering.Tests
- ClusterTraversalGroupTestsVixen.Rendering.Tests
- CompilesVixen.Rendering.Tests
- DrawCompactionTestsVixen.Rendering.Tests
- GpuClusterCullingVixen.Rendering
- GpuClusterCullingTestsVixen.Rendering.Tests
- GpuClusterVisibilityVixen.Rendering
- GpuDrawArgumentsVixen.Rendering
- GpuVisibilityGroupVixen.Rendering
- GpuVisibilityGroupTestsVixen.Rendering.Tests
- HiZPyramidVixen.Rendering
- ScreenPyramidDeviceTestsVixen.Graphics.Golden.Tests
- SkinnedClusterTestsVixen.Rendering.Tests
- SoftwareRasterVixen.Rendering
- ViewCullingDeviceTestsVixen.Graphics.Golden.Tests
- VirtualGeometryFrameTestsVixen.Rendering.Tests
- VirtualGeometryRenderFeatureVixen.Rendering
- VirtualShadowMapVixen.Rendering