mirror of
https://github.com/storytold/wgpu.git
synced 2026-11-22 23:41:01 +01:00
refactor: use From or Into for u32 -> u64 casts
This commit is contained in:
1 parent
fbc0388b61
commit
a18abddd33
3 files changed
+7
-6
No files matched your search
@@ -192,7 +192,7 @@ pub(crate) fn apply_hal_limits(mut limits: wgt::Limits) -> wgt::Limits {
|
||||
// Round some limits down to the WebGPU alignment requirement, to avoid
|
||||
// suggesting values that won't work. (In particular, the CTS queries limits
|
||||
// and then tests the exact limit value.)
|
||||
limits.max_storage_buffer_binding_size &= !(wgt::STORAGE_BINDING_SIZE_ALIGNMENT - 1) as u64;
|
||||
limits.max_storage_buffer_binding_size &= u64::from(!(wgt::STORAGE_BINDING_SIZE_ALIGNMENT - 1));
|
||||
limits.max_vertex_buffer_array_stride &= !(wgt::VERTEX_ALIGNMENT as u32 - 1);
|
||||
|
||||
limits
|
||||
|
||||
@@ -808,9 +808,10 @@ impl super::Adapter {
|
||||
max_uniform_buffers_per_shader_stage: full_heap_count,
|
||||
max_binding_array_elements_per_shader_stage: full_heap_count,
|
||||
max_binding_array_sampler_elements_per_shader_stage: full_heap_count,
|
||||
max_uniform_buffer_binding_size:
|
||||
Direct3D12::D3D12_REQ_CONSTANT_BUFFER_ELEMENT_COUNT as u64 * 16,
|
||||
max_storage_buffer_binding_size: auxil::MAX_I32_BINDING_SIZE as u64,
|
||||
max_uniform_buffer_binding_size: u64::from(
|
||||
Direct3D12::D3D12_REQ_CONSTANT_BUFFER_ELEMENT_COUNT,
|
||||
) * 16,
|
||||
max_storage_buffer_binding_size: u64::from(auxil::MAX_I32_BINDING_SIZE),
|
||||
max_vertex_buffers: Direct3D12::D3D12_VS_INPUT_REGISTER_COUNT,
|
||||
max_vertex_attributes: Direct3D12::D3D12_IA_VERTEX_INPUT_RESOURCE_SLOT_COUNT,
|
||||
max_vertex_buffer_array_stride: Direct3D12::D3D12_SO_BUFFER_MAX_STRIDE_IN_BYTES,
|
||||
|
||||
@@ -1458,11 +1458,11 @@ impl PhysicalDeviceProperties {
|
||||
max_uniform_buffer_binding_size: limits
|
||||
.max_uniform_buffer_range
|
||||
.min(crate::auxil::MAX_I32_BINDING_SIZE)
|
||||
as u64,
|
||||
.into(),
|
||||
max_storage_buffer_binding_size: limits
|
||||
.max_storage_buffer_range
|
||||
.min(crate::auxil::MAX_I32_BINDING_SIZE)
|
||||
as u64,
|
||||
.into(),
|
||||
max_vertex_buffers: limits.max_vertex_input_bindings,
|
||||
max_vertex_attributes: limits.max_vertex_input_attributes,
|
||||
max_vertex_buffer_array_stride: limits.max_vertex_input_binding_stride,
|
||||
|
||||
Reference in new issue
Block a user