#[repr(C)]pub struct GpuDrawArgs {
pub index_count: u32,
pub index_offset: u32,
pub base_vertex: u32,
pub flags: u32,
}Expand description
Per-object draw parameters consumed by the GPU-driven compute cull kernel.
Parallel to GpuObjectData (one record per DrawObject, same index):
GpuObjectData carries the cull bounds the kernel tests, this carries the
indexed-draw arguments the kernel encodes into the indirect command buffer
(Metal MTLIndirectCommandBuffer / DirectX ExecuteIndirect argument
buffer / Vulkan multiDrawIndexedIndirect buffer) when an object survives
the cull.
The kernel reads flags to decide an object’s fate without re-deriving it
from the AABB: ENABLED gates the per-frame visible / resident state,
CULLABLE selects whether the object is frustum/distance-tested at all
(mirrors DrawObject::cullable(): non-cullable objects always draw).
Layout (16 bytes) must stay in sync with the GpuDrawArgs struct in every
backend’s cull kernel: main.metal / the Metal build_cull_pipeline
MSL, the inline cull HLSL in directx/pipeline.rs, and the inline cull
GLSL in vulkan/pipeline.rs.
Fields§
§index_count: u32Number of indices to draw (DrawObject::index_count).
index_offset: u32Element offset into the shared index buffer (DrawObject::index_offset).
base_vertex: u32Value added to every index before the vertex fetch
(DrawObject::base_vertex; always >= 0 in practice).
flags: u32Cull-decision bits; see DrawArgsFlags.
Trait Implementations§
Source§impl Clone for GpuDrawArgs
impl Clone for GpuDrawArgs
Source§fn clone(&self) -> GpuDrawArgs
fn clone(&self) -> GpuDrawArgs
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more