Skip to content

Commit dc2b6de

Browse files
committed
ByteAddressableBuffer: fix oob calculation being too strict
1 parent 674dca7 commit dc2b6de

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

crates/spirv-std/src/byte_addressable_buffer.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ fn bounds_check<T>(data: &[u32], byte_index: u32) {
7171
panic!("`byte_index` should be a multiple of 4");
7272
}
7373
let last_byte = byte_index + sizeof;
74-
let len = data.len() as u32;
74+
let len = data.len() as u32 * 4;
7575
if byte_index + sizeof > len {
7676
panic!(
7777
"index out of bounds: the len is {} but loading {} bytes at `byte_index` {} reads until {} (exclusive)",

0 commit comments

Comments
 (0)