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"),
|
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();
|
let mut opaque_cmds = Vec::new();
|
||||||
if let Some(opaque) = phase_passes.get_vec(&Phase::Opaque) {
|
if let Some(opaque) = phase_passes.get_vec(&Phase::Opaque) {
|
||||||
|
|
|
@ -5,6 +5,7 @@
|
||||||
/// These variants are temporary and for testing purposes.
|
/// These variants are temporary and for testing purposes.
|
||||||
#[derive(Copy, Clone, Debug, Hash, Eq, Ord, PartialEq, PartialOrd, strum::EnumIter)]
|
#[derive(Copy, Clone, Debug, Hash, Eq, Ord, PartialEq, PartialOrd, strum::EnumIter)]
|
||||||
pub enum Phase {
|
pub enum Phase {
|
||||||
|
Upload,
|
||||||
Depth,
|
Depth,
|
||||||
Opaque,
|
Opaque,
|
||||||
Transparent,
|
Transparent,
|
||||||
|
@ -14,6 +15,7 @@ impl Phase {
|
||||||
pub fn get_kind(&self) -> PhaseKind {
|
pub fn get_kind(&self) -> PhaseKind {
|
||||||
use Phase::*;
|
use Phase::*;
|
||||||
match self {
|
match self {
|
||||||
|
Upload => PhaseKind::Command,
|
||||||
Depth | Opaque | Transparent => PhaseKind::Render,
|
Depth | Opaque | Transparent => PhaseKind::Render,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue