diff --git a/crates/bevy_render/src/batching/mod.rs b/crates/bevy_render/src/batching/mod.rs index 859d56e98d..6f16617fe7 100644 --- a/crates/bevy_render/src/batching/mod.rs +++ b/crates/bevy_render/src/batching/mod.rs @@ -88,7 +88,7 @@ pub fn batch_and_prepare_render_phase BatchedUniformBuffer { pub fn push(&mut self, component: T) -> GpuArrayBufferIndex { let result = GpuArrayBufferIndex { - index: NonMaxU32::new(self.temp.0.len() as u32).unwrap(), + index: self.temp.0.len() as u32, dynamic_offset: NonMaxU32::new(self.current_offset), element_type: PhantomData, }; diff --git a/crates/bevy_render/src/render_resource/gpu_array_buffer.rs b/crates/bevy_render/src/render_resource/gpu_array_buffer.rs index dbfe6a5962..1d314f0a1d 100644 --- a/crates/bevy_render/src/render_resource/gpu_array_buffer.rs +++ b/crates/bevy_render/src/render_resource/gpu_array_buffer.rs @@ -57,7 +57,7 @@ impl GpuArrayBuffer { GpuArrayBuffer::Uniform(buffer) => buffer.push(value), GpuArrayBuffer::Storage(buffer) => { let buffer = buffer.get_mut(); - let index = NonMaxU32::new(buffer.len() as u32).unwrap(); + let index = buffer.len() as u32; buffer.push(value); GpuArrayBufferIndex { index, @@ -109,7 +109,7 @@ impl GpuArrayBuffer { #[derive(Component, Clone)] pub struct GpuArrayBufferIndex { /// The index to use in a shader into the array. - pub index: NonMaxU32, + pub index: u32, /// The dynamic offset to use when setting the bind group in a pass. /// Only used on platforms that don't support storage buffers. pub dynamic_offset: Option,