pub struct Mesh3dRenderBudget { /* private fields */ }Expand description
Limits submitted surfaces and additional clip-space topology in one 3D draw.
Retained, wholly inside objects need no generated vertices. A crossing object’s surfaces are transformed and clipped together so one draw preserves their shared depth interpolation. Limits apply before GPU writes or clearing the target, and may be zero to disallow generated topology. The total surface limit includes both retained indices and newly generated triangles.
Implementations§
Source§impl Mesh3dRenderBudget
impl Mesh3dRenderBudget
Sourcepub const fn new(vertices: usize, triangles: usize, upload_bytes: usize) -> Self
pub const fn new(vertices: usize, triangles: usize, upload_bytes: usize) -> Self
Sets exact generated surface vertex, triangle, and total upload-byte
ceilings. Upload bytes include optional vertex colors, lighting/depth attributes and canonical
display-edge endpoints. The
total submitted surface count is unlimited unless explicitly bounded by
Self::with_max_surface_triangles.
Sourcepub const fn with_max_sorting_bytes(self, bytes: usize) -> Self
pub const fn with_max_sorting_bytes(self, bytes: usize) -> Self
Limits active order-record capacity in frames containing Blend objects. Zero rejects such frames. Opaque/masked-only frames use no order records, but may retain idle storage from earlier frames outside this active limit. Oversized retained storage is replaced before ordering under a smaller budget; actual active Vec capacity is checked before GPU writes or clearing.
Sourcepub const fn max_sorting_bytes(self) -> usize
pub const fn max_sorting_bytes(self) -> usize
Maximum active sorting-array capacity, independent of generated geometry.
Sourcepub const fn with_surface_policy(self, policy: SurfaceRasterization3d) -> Self
pub const fn with_surface_policy(self, policy: SurfaceRasterization3d) -> Self
Chooses surface raster portability for this draw. The default preserves strict cross-backend topology proofs. Display-edge validation remains independent of the selected surface policy.
Sourcepub const fn surface_policy(self) -> SurfaceRasterization3d
pub const fn surface_policy(self) -> SurfaceRasterization3d
Returns the explicitly selected surface rasterization policy.
Sourcepub const fn with_offscreen_surface_culling(self, enabled: bool) -> Self
pub const fn with_offscreen_surface_culling(self, enabled: bool) -> Self
Optionally omits Native surface-only objects proven wholly outside one frustum plane. Disabled by default; StrictPortable and objects with any active wireframe keep their original submissions. Inconclusive bounds keep drawing. This is not occlusion culling or host visibility mutation.
All original validation and budgets run first, including the unculled triangle limit. Actual submission and explicit culled counts are reported separately. Instance staging, sorting and retained memory are unchanged. Omission can split instanced draw runs; measure the tradeoff for the scene before enabling this option, especially for many small repeated meshes.
Sourcepub const fn offscreen_surface_culling(self) -> bool
pub const fn offscreen_surface_culling(self) -> bool
Whether conservative Native surface omission is requested for this draw.
Sourcepub const fn with_max_surface_triangles(self, triangles: usize) -> Self
pub const fn with_max_surface_triangles(self, triangles: usize) -> Self
Limits combined retained and generated surface triangles before optional
culling. Zero permits edge-only or empty submissions. Retained indices
still submitted for hardware clipping count even when outside the view.
Optional offscreen culling does not discount this admission limit; its
omission happens only after all unculled validation/budgets succeed.
Failure occurs before generated staging allocations, uploads or target
mutation and returns Mesh3dRenderError::SurfaceTriangleBudgetExceeded.
Sourcepub const fn max_surface_triangles(self) -> usize
pub const fn max_surface_triangles(self) -> usize
Returns the maximum combined retained/generated pre-culling submissions.
Sourcepub const fn max_generated_vertices(self) -> usize
pub const fn max_generated_vertices(self) -> usize
Returns the maximum generated clip-space vertices in one frame.
Sourcepub const fn max_generated_triangles(self) -> usize
pub const fn max_generated_triangles(self) -> usize
Returns the maximum generated triangle-list primitives in one frame.
Sourcepub const fn max_generated_upload_bytes(self) -> usize
pub const fn max_generated_upload_bytes(self) -> usize
Returns maximum bytes uploaded for generated surfaces and their edges.
Trait Implementations§
Source§impl Clone for Mesh3dRenderBudget
impl Clone for Mesh3dRenderBudget
Source§fn clone(&self) -> Mesh3dRenderBudget
fn clone(&self) -> Mesh3dRenderBudget
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for Mesh3dRenderBudget
Source§impl Debug for Mesh3dRenderBudget
impl Debug for Mesh3dRenderBudget
Source§impl Default for Mesh3dRenderBudget
impl Default for Mesh3dRenderBudget
impl Eq for Mesh3dRenderBudget
Source§impl PartialEq for Mesh3dRenderBudget
impl PartialEq for Mesh3dRenderBudget
impl StructuralPartialEq for Mesh3dRenderBudget
Auto Trait Implementations§
impl Freeze for Mesh3dRenderBudget
impl RefUnwindSafe for Mesh3dRenderBudget
impl Send for Mesh3dRenderBudget
impl Sync for Mesh3dRenderBudget
impl Unpin for Mesh3dRenderBudget
impl UnsafeUnpin for Mesh3dRenderBudget
impl UnwindSafe for Mesh3dRenderBudget
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.