cyborg/src/pass/mesh.rs

50 lines
1.3 KiB
Rust
Raw Normal View History

2022-04-05 04:21:14 +00:00
use super::*;
2022-04-18 08:21:19 +00:00
use crate::mesh::*;
2022-04-05 04:21:14 +00:00
pub struct FrameData {}
2022-04-05 04:21:14 +00:00
2022-04-18 08:21:19 +00:00
pub struct MeshPass {
attr_store: Arc<AttrStore>,
mesh_pool: Arc<MeshPool>,
}
2022-04-05 04:21:14 +00:00
impl MeshPass {
2022-04-18 08:21:19 +00:00
pub fn new(device: Arc<wgpu::Device>) -> Self {
let attr_store = AttrStore::new();
let mesh_pool = MeshPool::new(device, attr_store.to_owned());
Self {
attr_store,
mesh_pool,
}
2022-04-05 04:21:14 +00:00
}
}
impl RenderPass for MeshPass {
type FrameData = FrameData;
fn create_frame_data(&mut self) -> FrameData {
FrameData {}
2022-04-05 04:21:14 +00:00
}
2022-04-18 09:54:29 +00:00
fn begin_frame(&mut self, data: &mut FrameData, phases: &mut Vec<Phase>) {
2022-04-05 04:21:14 +00:00
println!("MeshPass::begin_frame()");
2022-04-18 09:54:29 +00:00
phases.push(Phase::Depth);
phases.push(Phase::Opaque);
phases.push(Phase::Transparent);
}
2022-04-18 09:54:29 +00:00
fn record_commands(&self, data: PhaseData<&FrameData>, cmds: &mut wgpu::CommandEncoder) {
println!("MeshPass::record_commands(phase: {:?})", data.phase);
2022-04-05 04:21:14 +00:00
}
2022-04-18 09:54:29 +00:00
fn record_compute(&self, data: PhaseData<&FrameData>, cmds: &mut wgpu::ComputePass) {
println!("MeshPass::record_compute(phase: {:?})", data.phase);
2022-04-05 04:21:14 +00:00
}
2022-04-18 09:54:29 +00:00
fn record_render(&self, data: PhaseData<&FrameData>, cmds: &mut wgpu::RenderBundleEncoder) {
println!("MeshPass::record_render(phase: {:?})", data.phase);
2022-04-05 04:21:14 +00:00
}
}