pub struct CustomWaveRenderer {
pipelines: [RenderPipeline; 4],
vertex_buffer: Buffer,
vertex_count: u32,
batches: Vec<CustomWaveBatch>,
}Expand description
Custom-wave GPU pass. Owns one growable vertex buffer + two
pipelines (lines and dots topology, alpha and additive blend = 4
combinations, indexed by pipeline_index(dots, additive)).
Fields§
§pipelines: [RenderPipeline; 4]§vertex_buffer: Buffer§vertex_count: u32Logical vertex count after the most recent upload (0 when no custom waves are enabled).
batches: Vec<CustomWaveBatch>Per-wave dispatch metadata, in stream order.
Implementations§
Source§impl CustomWaveRenderer
impl CustomWaveRenderer
pub fn new(device: &Device, format: TextureFormat) -> Self
Sourcepub fn update(
&mut self,
queue: &Queue,
vertices: &[CustomWaveVertex],
batches: &[CustomWaveBatch],
)
pub fn update( &mut self, queue: &Queue, vertices: &[CustomWaveVertex], batches: &[CustomWaveBatch], )
Replace the per-frame vertex stream and batch list. The combined
vertex count is clamped to MAX_CUSTOM_WAVE_VERTICES; any tail
past that is dropped (with a log::warn so it’s visible in
long-running sessions).
Sourcepub fn render(&self, encoder: &mut CommandEncoder, view: &TextureView)
pub fn render(&self, encoder: &mut CommandEncoder, view: &TextureView)
Issue one draw call per stored batch into view. Loads existing
contents (no clear) — meant to draw on top of the warp + legacy
waveform output.
Sourcepub fn vertex_count(&self) -> u32
pub fn vertex_count(&self) -> u32
Number of vertices held by the most recent Self::update call.
Exposed for tests asserting the upload size.
Sourcepub fn batch_count(&self) -> usize
pub fn batch_count(&self) -> usize
Number of dispatch batches the next Self::render will issue.
Auto Trait Implementations§
impl Freeze for CustomWaveRenderer
impl !RefUnwindSafe for CustomWaveRenderer
impl Send for CustomWaveRenderer
impl Sync for CustomWaveRenderer
impl Unpin for CustomWaveRenderer
impl !UnwindSafe for CustomWaveRenderer
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more