pub struct SpritePipeline {
pipeline_alpha: RenderPipeline,
pipeline_additive: RenderPipeline,
bgl: BindGroupLayout,
uniform_buffer: Buffer,
uniform_stride: u64,
}Expand description
Sprite GPU pipeline. Owns two RenderPipelines (alpha + additive)
and a per-slot uniform buffer; the renderer constructs / drives it
once per chain.
Fields§
§pipeline_alpha: RenderPipeline§pipeline_additive: RenderPipeline§bgl: BindGroupLayout§uniform_buffer: BufferMAX_ACTIVE_SPRITES * UNIFORM_STRIDE bytes; each draw writes
at its slot’s offset. UNIFORM_STRIDE is rounded up to the
device’s min uniform-buffer offset alignment so dynamic
offsets land on a valid boundary.
uniform_stride: u64Implementations§
Source§impl SpritePipeline
impl SpritePipeline
pub fn new(device: &Device, format: TextureFormat) -> Self
Sourcepub fn record(
&self,
encoder: &mut CommandEncoder,
queue: &Queue,
device: &Device,
target: &TextureView,
sampler: &Sampler,
cmds: &[SpriteDrawCmd<'_>],
)
pub fn record( &self, encoder: &mut CommandEncoder, queue: &Queue, device: &Device, target: &TextureView, sampler: &Sampler, cmds: &[SpriteDrawCmd<'_>], )
Record one sprite-pass draw set into the encoder. cmds
must be <= MAX_ACTIVE_SPRITES; longer slices are truncated
to keep the per-frame allocation budget predictable.
Auto Trait Implementations§
impl Freeze for SpritePipeline
impl !RefUnwindSafe for SpritePipeline
impl Send for SpritePipeline
impl Sync for SpritePipeline
impl Unpin for SpritePipeline
impl !UnwindSafe for SpritePipeline
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
Mutably borrows from an owned value. Read more
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>
Converts
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>
Converts
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