WIP#18
Conversation
|
You're a star for making this work! 🚀🌟 |
| .build(device.clone()) | ||
| .unwrap(); | ||
|
|
||
| // Dynamic viewports allow us to recreate just the viewport when the window is resized. |
| ); | ||
| // 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.
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.
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.
This is just me trying to understand things, not any suggestion of how things should be done 😅
|
|
||
| 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.
Isn't the expects nicer?
https://stackoverflow.com/questions/61301581/when-should-we-use-unwrap-vs-expect-in-rust
No description provided.