-
Notifications
You must be signed in to change notification settings - Fork 0
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
WIP #18
base: main
Are you sure you want to change the base?
WIP #18
Conversation
You're a star for making this work! 🚀🌟 |
|
||
// Dynamic viewports allow us to recreate just the viewport when the window is resized. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Niceee
); | ||
// Destroying the `GpuFuture` blocks until the GPU is finished executing it. In order to avoid | ||
// that, we store the submission of the previous frame here. | ||
let mut previous_frame_end = Some(sync::now(device.clone()).boxed()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure I follow, could you explain this to me like I'm 3, how does this allow us to execute the GPU code in a non-blocking way on line 354 compared to if we would not have this reference?
use vulkano::device::DeviceExtensions; | ||
|
||
let device_extensions = DeviceExtensions { | ||
// Swapchain is needed to present images to a surface. The `khr_swapchain` provides that. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess we could just draw on the surface directly while the swapchain gives us the opportunity to be 100% sure that all rendering finished before presenting?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is just me trying to understand things, not any suggestion of how things should be done 😅
) | ||
.unwrap(); | ||
|
||
let vs = vs::load(device.clone()).expect("failed to create shader module"); | ||
let fs = fs::load(device.clone()).expect("failed to create shader module"); | ||
let vs = vs::load(device.clone()).unwrap(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't the expects nicer?
https://stackoverflow.com/questions/61301581/when-should-we-use-unwrap-vs-expect-in-rust
No description provided.