mirror of
https://github.com/gfx-rs/wgpu.git
synced 2025-12-08 21:26:17 +00:00
Two small vulkan changes (#8001)
This commit is contained in:
parent
d8b7e81a02
commit
bf86ac3489
@ -1175,13 +1175,14 @@ impl PhysicalDeviceProperties {
|
|||||||
None => (0, 0, 0, 0),
|
None => (0, 0, 0, 0),
|
||||||
};
|
};
|
||||||
|
|
||||||
// Prevent very large buffers on mesa and most android devices.
|
// Prevent very large buffers on mesa and most android devices, and in all cases
|
||||||
|
// don't risk confusing JS by exceeding the range of a double.
|
||||||
let is_nvidia = self.properties.vendor_id == crate::auxil::db::nvidia::VENDOR;
|
let is_nvidia = self.properties.vendor_id == crate::auxil::db::nvidia::VENDOR;
|
||||||
let max_buffer_size =
|
let max_buffer_size =
|
||||||
if (cfg!(target_os = "linux") || cfg!(target_os = "android")) && !is_nvidia {
|
if (cfg!(target_os = "linux") || cfg!(target_os = "android")) && !is_nvidia {
|
||||||
i32::MAX as u64
|
i32::MAX as u64
|
||||||
} else {
|
} else {
|
||||||
u64::MAX
|
1u64 << 52
|
||||||
};
|
};
|
||||||
|
|
||||||
let mut max_binding_array_elements = 0;
|
let mut max_binding_array_elements = 0;
|
||||||
|
|||||||
@ -236,7 +236,7 @@ impl super::DeviceShared {
|
|||||||
&self,
|
&self,
|
||||||
buffer: &'a super::Buffer,
|
buffer: &'a super::Buffer,
|
||||||
ranges: I,
|
ranges: I,
|
||||||
) -> Option<impl 'a + Iterator<Item = vk::MappedMemoryRange>> {
|
) -> Option<impl 'a + Iterator<Item = vk::MappedMemoryRange<'a>>> {
|
||||||
let block = buffer.block.as_ref()?.lock();
|
let block = buffer.block.as_ref()?.lock();
|
||||||
let mask = self.private_caps.non_coherent_map_mask;
|
let mask = self.private_caps.non_coherent_map_mask;
|
||||||
Some(ranges.map(move |range| {
|
Some(ranges.map(move |range| {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user