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

[vulkan] Don't bother to free command buffers before destroying the pool. #4059

Merged
merged 1 commit into from
Aug 16, 2023
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
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@ Bottom level categories:

- Omit texture store bound checks since they are no-ops if out of bounds on all APIs. By @teoxoy in [#3975](https://github.com/gfx-rs/wgpu/pull/3975)

#### Vulkan

- Don't bother calling `vkFreeCommandBuffers` when `vkDestroyCommandPool` will take care of that for us. By @jimblandy in [#4059](https://github.com/gfx-rs/wgpu/pull/4059)

### Bug Fixes

#### General
Expand Down
14 changes: 4 additions & 10 deletions wgpu-hal/src/vulkan/device.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1192,16 +1192,10 @@ impl crate::Device<super::Api> for super::Device {
}
unsafe fn destroy_command_encoder(&self, cmd_encoder: super::CommandEncoder) {
unsafe {
if !cmd_encoder.free.is_empty() {
self.shared
.raw
.free_command_buffers(cmd_encoder.raw, &cmd_encoder.free)
}
if !cmd_encoder.discarded.is_empty() {
self.shared
.raw
.free_command_buffers(cmd_encoder.raw, &cmd_encoder.discarded)
}
// `vkDestroyCommandPool` also frees any command buffers allocated
// from that pool, so there's no need to explicitly call
// `vkFreeCommandBuffers` on `cmd_encoder`'s `free` and `discarded`
// fields.
self.shared.raw.destroy_command_pool(cmd_encoder.raw, None);
}
}
Expand Down