Skip to main content

Module cull

Module cull 

Source
Expand description

GPU-driven culling service published to plugins.

A plugin that submits its own instanced geometry can run the lib’s frustum-cull compute against its instance AABB buffer to get a compacted visibility list and a DrawIndexedIndirect entry suitable for draw_indexed_indirect.

CullSubmission carries the buffers for a multi-batch cull: one big AABB list, one BatchMeta entry per batch, one atomic counter slot per batch, and one indirect-draw entry per batch. Plugins with many meshes pack them all into one submission so the renderer dispatches the compute pass once for the whole group.

For the common one-mesh-N-instances case, see crate::renderer::ViewportRenderer::submit_cull_single_mesh. It takes the per-mesh draw parameters directly and fills the lib’s scratch meta + counter buffers for you.

Submit via crate::renderer::ViewportRenderer::submit_cull or crate::renderer::ViewportRenderer::submit_cull_shadow.

Re-exports§

pub use crate::resources::BatchMeta;

Structs§

CullSubmission
Inputs to one cull dispatch.
InstanceAabb
Per-instance world-space bounding box for GPU culling.
SingleMeshDraw
Draw parameters for a one-mesh-N-instances submission.