From f3a0dd9b6372d37b8a1505709729bffebc5b78a9 Mon Sep 17 00:00:00 2001 From: Dzmitry Malyshau Date: Thu, 24 Oct 2019 10:50:08 -0400 Subject: [PATCH] Allow max_bind_groups to be missing, for now --- wgpu-native/src/instance.rs | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/wgpu-native/src/instance.rs b/wgpu-native/src/instance.rs index a9390ea485..51469893ca 100644 --- a/wgpu-native/src/instance.rs +++ b/wgpu-native/src/instance.rs @@ -19,7 +19,7 @@ use crate::{gfx_select, SurfaceId}; #[cfg(not(feature = "remote"))] use bitflags::bitflags; -use log::info; +use log::{info, warn}; #[cfg(feature = "remote")] use serde::{Deserialize, Serialize}; @@ -466,10 +466,14 @@ pub fn adapter_request_device( BIND_BUFFER_ALIGNMENT % limits.min_uniform_buffer_offset_alignment, "Adapter uniform buffer offset alignment not compatible with WGPU" ); - assert!( - u32::from(limits.max_bound_descriptor_sets) >= desc.limits.max_bind_groups, - "Adapter does not support the requested max_bind_groups" - ); + if desc.limits.max_bind_groups == 0 { + warn!("max_bind_groups limit is missing"); + } else { + assert!( + u32::from(limits.max_bound_descriptor_sets) >= desc.limits.max_bind_groups, + "Adapter does not support the requested max_bind_groups" + ); + } let mem_props = adapter.physical_device.memory_properties();