208: Ensure wait_for_fences is never called on 0 fences r=kvark a=rukai

I don't see any reason why self.active should never be empty.

This fixes the validation errors but not the slowdown of https://github.com/gfx-rs/wgpu/issues/207
I presume the slowdown was causing self.active to clear.

Co-authored-by: Rukai <rubickent@gmail.com>
This commit is contained in:
bors[bot] 2019-06-03 16:13:56 +00:00
commit 0642509deb

View File

@ -177,7 +177,7 @@ impl<B: hal::Backend> PendingResources<B> {
heaps_mutex: &Mutex<Heaps<B>>,
force_wait: bool,
) -> SubmissionIndex {
if force_wait {
if force_wait && !self.active.is_empty() {
let status = unsafe {
device.wait_for_fences(
self.active.iter().map(|a| &a.fence),