Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: create a history queue if required_images is 1 #150

Merged
merged 1 commit into from
Nov 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions librashader-runtime/src/binding.rs
Original file line number Diff line number Diff line change
Expand Up @@ -395,6 +395,7 @@ where
}
}

#[derive(Debug)]
pub struct BindingRequirements {
pub(crate) required_history: usize,
pub(crate) uses_final_pass_as_feedback: bool,
Expand Down
5 changes: 4 additions & 1 deletion librashader-runtime/src/framebuffer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,10 @@ fn init_history<'a, F, I, E>(
owned_generator: impl Fn() -> Result<F, E>,
input_generator: impl Fn() -> I,
) -> Result<(VecDeque<F>, Box<[I]>), E> {
if required_images <= 1 {
// Since OriginalHistory0 aliases source, it always gets bound if present, and we don't need to
// store it. However, if even OriginalHistory1 is used, then we need to store it, hence we check if
// required_images is less than 1, and only then do we return an empty history queue.
if required_images < 1 {
return Ok((VecDeque::new(), Box::new([])));
}

Expand Down