Skip to content

Conversation

demurgos
Copy link
Contributor

@demurgos demurgos commented Oct 14, 2019

PR checklist:

  • make succeeds (on *nix)
  • make reftests succeeds
  • tested examples with the following backends: vulkan, gl (wasm)
  • rustfmt run on changed code

Fix validation errors in quad example

This commit fixes the Vulkan validation errors for the quad example:

  • The framebuffer is destroyed without waiting for the command buffer to be executed.
  • The swapchain is not destroyed.

This commit also adds a small comment explaining why main extends the lifetime of window beyond its initial scope.

@demurgos demurgos force-pushed the quad-validation-error branch from c94d227 to dcf3bd7 Compare October 14, 2019 15:13
@demurgos demurgos changed the title Fix vkDestroyFramebuffer validation error in quad example Fix validation errors in quad example Oct 14, 2019
.expect("Failed to create an instance!");
let surface = instance.create_surface(&window).expect("Failed to create a surface!");
let adapters = instance.enumerate_adapters();
// Return `window` so it is not dropped: dropping it invalidates `surface`.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

This commit fixes the Vulkan validation errors caused by not destroying the swapchain.

It also fixes a typo and adds a small comment explaining why `main` extends the lifetime of `window` beyond its initial scope.
@demurgos demurgos force-pushed the quad-validation-error branch from dcf3bd7 to 8e8d801 Compare October 15, 2019 16:47
Copy link
Member

@kvark kvark left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!
bors r+

bors bot added a commit that referenced this pull request Oct 15, 2019
3043: Fix validation errors in quad example r=kvark a=demurgos

PR checklist:
- [x] `make` succeeds (on *nix)
- [x] `make reftests` succeeds
- [x] tested examples with the following backends: vulkan, gl (wasm)
- [x] `rustfmt` run on changed code

Fix validation errors in quad example

This commit fixes the Vulkan validation errors for the `quad` example:
- The framebuffer is destroyed without waiting for the command buffer to be executed.
- The swapchain is not destroyed.

This commit also adds a small comment explaining why `main` extends the lifetime of `window` beyond its initial scope.


Co-authored-by: Charles Samborski <demurgos@demurgos.net>
@bors
Copy link
Contributor

bors bot commented Oct 15, 2019

Build succeeded

@bors bors bot merged commit 8e8d801 into gfx-rs:master Oct 15, 2019
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

Successfully merging this pull request may close these issues.

3 participants