chore: Fix legacy_numeric_constants lints (#5747)

These are being deprecated in the future in favor of the associated
constants (which are already being used in some code here), so this
consistently uses the preferred forms.
This commit is contained in:
Bruce Mitchener authored and GitHub committed 2024-05-26 08:36:19 +02:00
1 parent 5da72a94d5
commit 7368e5107c
7 files changed
+11 -11

No files matched your search

+1 -1
View File
@@ -30,7 +30,7 @@ fn create_texels(size: usize, cx: f32, cy: f32) -> Vec<u8> {
iter::once(0xFF - (count * 2) as u8)
.chain(iter::once(0xFF - (count * 5) as u8))
.chain(iter::once(0xFF - (count * 13) as u8))
.chain(iter::once(std::u8::MAX))
.chain(iter::once(u8::MAX))
})
.collect()
}
+1 -1
View File
@@ -124,7 +124,7 @@ impl HexTerrainMesh {
let width = q_given_r(radius);
let half_width = (width / 2) as isize;
let mut map = HashMap::new();
let mut max = std::f32::NEG_INFINITY;
let mut max = f32::NEG_INFINITY;
for i in -half_width..=half_width {
let x_o = i as f32;
for j in -half_width..=half_width {
+4 -4
View File
@@ -61,10 +61,10 @@ impl TextureInitTracker {
&self,
action: &TextureInitTrackerAction<A>,
) -> Option<TextureInitTrackerAction<A>> {
let mut mip_range_start = std::usize::MAX;
let mut mip_range_end = std::usize::MIN;
let mut layer_range_start = std::u32::MAX;
let mut layer_range_end = std::u32::MIN;
let mut mip_range_start = usize::MAX;
let mut mip_range_end = usize::MIN;
let mut layer_range_start = u32::MAX;
let mut layer_range_end = u32::MIN;
for (i, mip_tracker) in self
.mips
+1 -1
View File
@@ -797,7 +797,7 @@ impl super::Adapter {
},
max_compute_workgroups_per_dimension,
max_buffer_size: i32::MAX as u64,
max_non_sampler_bindings: std::u32::MAX,
max_non_sampler_bindings: u32::MAX,
};
let mut workarounds = super::Workarounds::empty();
+1 -1
View File
@@ -981,7 +981,7 @@ impl super::PrivateCapabilities {
max_compute_workgroup_size_z: self.max_threads_per_group,
max_compute_workgroups_per_dimension: 0xFFFF,
max_buffer_size: self.max_buffer_size,
max_non_sampler_bindings: std::u32::MAX,
max_non_sampler_bindings: u32::MAX,
},
alignments: crate::Alignments {
buffer_copy_offset: wgt::BufferSize::new(self.buffer_alignment).unwrap(),
+2 -2
View File
@@ -1047,7 +1047,7 @@ impl PhysicalDeviceProperties {
max_compute_workgroup_size_z: max_compute_workgroup_sizes[2],
max_compute_workgroups_per_dimension,
max_buffer_size,
max_non_sampler_bindings: std::u32::MAX,
max_non_sampler_bindings: u32::MAX,
}
}
@@ -1807,7 +1807,7 @@ impl super::Adapter {
if let Some(maintenance_3) = self.phd_capabilities.maintenance_3 {
maintenance_3.max_memory_allocation_size
} else {
u64::max_value()
u64::MAX
};
let properties = gpu_alloc::DeviceProperties {
max_memory_allocation_count: limits.max_memory_allocation_count,
+1 -1
View File
@@ -28,7 +28,7 @@ pub use wgt::{math::*, DispatchIndirectArgs, DrawIndexedIndirectArgs, DrawIndire
/// This function panics if:
///
/// - Input length isn't multiple of 4
/// - Input is longer than [`usize::max_value`]
/// - Input is longer than [`usize::MAX`]
/// - Input is empty
/// - SPIR-V magic number is missing from beginning of stream
#[cfg(feature = "spirv")]