52 lines
1.0 KiB
Rust
52 lines
1.0 KiB
Rust
//! Intermediate CPU-mappable, GPU-visible storage for transferral to an attribute pool.
|
|
//!
|
|
//! TODO: double-buffered staging
|
|
|
|
use super::*;
|
|
use std::collections::VecDeque;
|
|
|
|
pub struct StagingPool {
|
|
stage_size: usize,
|
|
current_budget: usize,
|
|
copies: Vec<CopyInfo>,
|
|
spillover: VecDeque<SpilloverBuffer>,
|
|
}
|
|
|
|
impl StagingPool {
|
|
pub fn new(stage_size: usize) -> Self {
|
|
Self {
|
|
stage_size,
|
|
current_budget: 0,
|
|
copies: Default::default(),
|
|
spillover: Default::default(),
|
|
}
|
|
}
|
|
|
|
pub fn flush(&mut self) {
|
|
todo!()
|
|
}
|
|
|
|
pub fn queue_copies(&mut self, copies: Vec<CopyInfo>) {
|
|
todo!()
|
|
}
|
|
}
|
|
|
|
pub struct CopyInfo {
|
|
/// The index of the target attribute pool's group.
|
|
pub group: usize,
|
|
|
|
/// The target attribute pool within the group.
|
|
pub target: AttrId,
|
|
|
|
/// The destination offset *in bytes.*
|
|
pub offset: usize,
|
|
|
|
/// The copy size *in bytes.*
|
|
pub size: usize,
|
|
}
|
|
|
|
pub struct SpilloverBuffer {
|
|
pub info: CopyInfo,
|
|
pub data: Vec<u8>,
|
|
}
|