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

07-windowing not recreating commandbuffers with new framebuffers if window didn't resize #44

Open
mickvangelderen opened this issue Feb 7, 2025 · 3 comments

Comments

@mickvangelderen
Copy link

I just started getting serious with this whole vulkan business and there is something in the book that I do not understand. It is about this code here:

let new_framebuffers = get_framebuffers(&new_images, render_pass.clone());
if window_resized {
window_resized = false;
viewport.extent = new_dimensions.into();
let new_pipeline = get_pipeline(
device.clone(),
vs.clone(),
fs.clone(),
render_pass.clone(),
viewport.clone(),
);
command_buffers = get_command_buffers(
&command_buffer_allocator,
&queue,
&new_pipeline,
&new_framebuffers,
&vertex_buffer,
);
}

There are two booleans: recreate_swapchain and window_resized. The code only recreates the command buffers is window_resized is true, even though they seem to depend on other data (the framebuffers in particular) that is being recreated. Is this intentional or should the if windows_resized check be removed?

@marc0246
Copy link
Contributor

marc0246 commented Feb 7, 2025

This whole chapter is all wrong. We need to rewrite it. We have some actual good examples over at the vulkano repo.

@mickvangelderen
Copy link
Author

mickvangelderen commented Feb 7, 2025

All wrong? In that case it would be friendly to add a warning to the top if the rewrite is not going to be out soon.

@mickvangelderen
Copy link
Author

mickvangelderen commented Feb 7, 2025

@marc0246 Those examples are really good, thanks! Given the amount of documentation through comments, just pointing out the various winit examples in the book would be good enough for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants