equal
deleted
inserted
replaced
171 data: &[u8], |
171 data: &[u8], |
172 data_stride: Option<NonZeroU32>, |
172 data_stride: Option<NonZeroU32>, |
173 format: TextureFormat, |
173 format: TextureFormat, |
174 data_type: TextureDataType, |
174 data_type: TextureDataType, |
175 ) { |
175 ) { |
176 if is_out_of_bounds(data, data_stride, self.size) { |
|
177 return; |
|
178 } |
|
179 |
|
180 if let Some(handle) = self.handle { |
176 if let Some(handle) = self.handle { |
181 unsafe { |
177 unsafe { |
182 gl::BindTexture(gl::TEXTURE_2D, handle.get()); |
178 gl::BindTexture(gl::TEXTURE_2D, handle.get()); |
183 gl::PixelStorei(gl::UNPACK_ROW_LENGTH, get_u32(data_stride) as i32); |
179 gl::PixelStorei(gl::UNPACK_ROW_LENGTH, get_u32(data_stride) as i32); |
184 gl::TexSubImage2D( |
180 gl::TexSubImage2D( |