Skip to content

Commit ae5a78f

Browse files
bors[bot]kvark
andauthored
Merge #356
356: Allow max_bind_groups to be missing, for now r=kvark a=kvark Fixes #355 Co-authored-by: Dzmitry Malyshau <[email protected]>
2 parents a04a4b1 + f3a0dd9 commit ae5a78f

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

wgpu-native/src/instance.rs

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ use crate::{gfx_select, SurfaceId};
1919

2020
#[cfg(not(feature = "remote"))]
2121
use bitflags::bitflags;
22-
use log::info;
22+
use log::{info, warn};
2323
#[cfg(feature = "remote")]
2424
use serde::{Deserialize, Serialize};
2525

@@ -466,10 +466,14 @@ pub fn adapter_request_device<B: GfxBackend>(
466466
BIND_BUFFER_ALIGNMENT % limits.min_uniform_buffer_offset_alignment,
467467
"Adapter uniform buffer offset alignment not compatible with WGPU"
468468
);
469-
assert!(
470-
u32::from(limits.max_bound_descriptor_sets) >= desc.limits.max_bind_groups,
471-
"Adapter does not support the requested max_bind_groups"
472-
);
469+
if desc.limits.max_bind_groups == 0 {
470+
warn!("max_bind_groups limit is missing");
471+
} else {
472+
assert!(
473+
u32::from(limits.max_bound_descriptor_sets) >= desc.limits.max_bind_groups,
474+
"Adapter does not support the requested max_bind_groups"
475+
);
476+
}
473477

474478
let mem_props = adapter.physical_device.memory_properties();
475479

0 commit comments

Comments
 (0)