Add and record Upload phase
This commit is contained in:
parent
ba12827dd6
commit
8a3dac008a
13
src/lib.rs
13
src/lib.rs
|
@ -86,6 +86,19 @@ impl Renderer {
|
|||
label: Some("Render Encoder"),
|
||||
});
|
||||
|
||||
if let Some(upload) = phase_passes.get_vec(&Phase::Upload) {
|
||||
upload.iter().for_each(|pass_index| {
|
||||
let frame_data = IndexedPhaseData {
|
||||
phase: Phase::Upload,
|
||||
frame_data: frame_index,
|
||||
viewport: &viewport,
|
||||
};
|
||||
|
||||
let pass = &self.render_passes[*pass_index];
|
||||
pass.record_commands(frame_data, &mut encoder);
|
||||
});
|
||||
}
|
||||
|
||||
{
|
||||
let mut opaque_cmds = Vec::new();
|
||||
if let Some(opaque) = phase_passes.get_vec(&Phase::Opaque) {
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
/// These variants are temporary and for testing purposes.
|
||||
#[derive(Copy, Clone, Debug, Hash, Eq, Ord, PartialEq, PartialOrd, strum::EnumIter)]
|
||||
pub enum Phase {
|
||||
Upload,
|
||||
Depth,
|
||||
Opaque,
|
||||
Transparent,
|
||||
|
@ -14,6 +15,7 @@ impl Phase {
|
|||
pub fn get_kind(&self) -> PhaseKind {
|
||||
use Phase::*;
|
||||
match self {
|
||||
Upload => PhaseKind::Command,
|
||||
Depth | Opaque | Transparent => PhaseKind::Render,
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue