Add and record Upload phase

This commit is contained in:
mars 2022-04-18 20:12:10 -06:00
parent ba12827dd6
commit 8a3dac008a
2 changed files with 15 additions and 0 deletions

View File

@ -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) {

View File

@ -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,
}
}