Skip to content

Commit bf86ac3

Browse files
Two small vulkan changes (#8001)
1 parent d8b7e81 commit bf86ac3

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

wgpu-hal/src/vulkan/adapter.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1175,13 +1175,14 @@ impl PhysicalDeviceProperties {
11751175
None => (0, 0, 0, 0),
11761176
};
11771177

1178-
// Prevent very large buffers on mesa and most android devices.
1178+
// Prevent very large buffers on mesa and most android devices, and in all cases
1179+
// don't risk confusing JS by exceeding the range of a double.
11791180
let is_nvidia = self.properties.vendor_id == crate::auxil::db::nvidia::VENDOR;
11801181
let max_buffer_size =
11811182
if (cfg!(target_os = "linux") || cfg!(target_os = "android")) && !is_nvidia {
11821183
i32::MAX as u64
11831184
} else {
1184-
u64::MAX
1185+
1u64 << 52
11851186
};
11861187

11871188
let mut max_binding_array_elements = 0;

wgpu-hal/src/vulkan/device.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ impl super::DeviceShared {
236236
&self,
237237
buffer: &'a super::Buffer,
238238
ranges: I,
239-
) -> Option<impl 'a + Iterator<Item = vk::MappedMemoryRange>> {
239+
) -> Option<impl 'a + Iterator<Item = vk::MappedMemoryRange<'a>>> {
240240
let block = buffer.block.as_ref()?.lock();
241241
let mask = self.private_caps.non_coherent_map_mask;
242242
Some(ranges.map(move |range| {

0 commit comments

Comments
 (0)