Skip to content

Commit

Permalink
fix: wrong source stage for resources that had a last version with bo…
Browse files Browse the repository at this point in the history
…th output and input
  • Loading branch information
NotAPenguin0 committed Apr 19, 2023
1 parent 3d0ae3d commit e2d6b29
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
3 changes: 3 additions & 0 deletions src/graph/pass.rs
Original file line number Diff line number Diff line change
Expand Up @@ -139,11 +139,14 @@ impl<D: ExecutionDomain, U, A: Allocator> PassExecutor<D, U, A> for EmptyPassExe
}

/// Represents one pass in a GPU task graph. You can obtain one using a [`PassBuilder`].
#[derive(Derivative)]
#[derivative(Debug)]
pub struct Pass<'cb, D: ExecutionDomain, U = (), A: Allocator = DefaultAllocator> {
pub(crate) name: String,
pub(crate) color: Option<[f32; 4]>,
pub(crate) inputs: Vec<PassResource>,
pub(crate) outputs: Vec<PassResource>,
#[derivative(Debug = "ignore")]
pub(crate) execute: BoxedPassFn<'cb, D, U, A>,
pub(crate) is_renderpass: bool,
}
Expand Down
8 changes: 4 additions & 4 deletions src/graph/pass_graph.rs
Original file line number Diff line number Diff line change
Expand Up @@ -205,9 +205,9 @@ impl<'cb, D: ExecutionDomain, U, A: Allocator> PassGraph<'cb, D, U, A> {
self.update_last_usage(&input.resource, input.stage)?;
}

for output in &pass.outputs {
self.update_last_usage(&output.resource, output.stage)?;
}
//for output in &pass.outputs {
// self.update_last_usage(&output.resource, output.stage)?;
//}

self.graph.add_task(PassNode {
identifier: pass.name,
Expand Down Expand Up @@ -257,7 +257,7 @@ impl<'cb, D: ExecutionDomain, U, A: Allocator> PassGraph<'cb, D, U, A> {
match entry {
Entry::Occupied(mut entry) => {
let version = resource.version();
if version > entry.get().0 {
if version >= entry.get().0 {
entry.insert((version, stage));
}
}
Expand Down

0 comments on commit e2d6b29

Please sign in to comment.