Fix 3d texture data length check
@@ -99,7 +99,7 @@ impl<T: TextureDataType> Texture3D<T> {
/// Return an error if the length of the data array is smaller or bigger than the necessary number of bytes to fill the entire texture.
///
pub fn fill(&mut self, data: &[T]) -> ThreeDResult<()> {
- check_data_length(self.width, self.height, 1, self.format, data.len())?;
+ check_data_length(self.width, self.height, self.depth, self.format, data.len())?;
self.context.bind_texture(consts::TEXTURE_3D, &self.id);
T::fill(
&self.context,
