Validate set_bind_group is within bounds of limit

This commit is contained in:
Connor Fitzgerald committed 2020-07-07 14:41:54 -04:00
1 parent cfd21d4913
commit f76b631961
3 files changed
+21

No files matched your search

+7
View File
@@ -528,6 +528,13 @@ impl<G: GlobalIdentityHandlerFactory> Global<G> {
num_dynamic_offsets,
bind_group_id,
} => {
assert!(
(index as u32) < device.limits.max_bind_groups,
"Bind group index {0} is out of range 0..{1} provided by requested max_bind_group limit {1}",
index,
device.limits.max_bind_groups
);
let offsets = &base.dynamic_offsets[..num_dynamic_offsets as usize];
base.dynamic_offsets =
&base.dynamic_offsets[num_dynamic_offsets as usize..];
+7
View File
@@ -157,6 +157,13 @@ impl<G: GlobalIdentityHandlerFactory> Global<G> {
num_dynamic_offsets,
bind_group_id,
} => {
assert!(
(index as u32) < cmb.limits.max_bind_groups,
"Bind group index {0} is out of range 0..{1} provided by requested max_bind_group limit {1}",
index,
cmb.limits.max_bind_groups
);
let offsets = &base.dynamic_offsets[..num_dynamic_offsets as usize];
base.dynamic_offsets = &base.dynamic_offsets[num_dynamic_offsets as usize..];
+7
View File
@@ -875,6 +875,13 @@ impl<G: GlobalIdentityHandlerFactory> Global<G> {
num_dynamic_offsets,
bind_group_id,
} => {
assert!(
(index as u32) < device.limits.max_bind_groups,
"Bind group index {0} is out of range 0..{1} provided by requested max_bind_group limit {1}",
index,
device.limits.max_bind_groups
);
let offsets = &base.dynamic_offsets[..num_dynamic_offsets as usize];
base.dynamic_offsets = &base.dynamic_offsets[num_dynamic_offsets as usize..];