pub fn pad_rgba_rows(rgba: &[u8], px_size: u32) -> (Vec<u8>, u32)Expand description
Pads rows to 256-byte alignment for queue.write_texture.
rgba must contain at least px_size * px_size * 4 bytes. The returned row
pitch is the smallest multiple of 256 that can hold one RGBA row; padding is
zero-filled.
§Panics
Panics for a short source slice, arithmetic overflow, or allocation failure.
§Examples
use ailloli_ui_render_wgpu::icons::raster::pad_rgba_rows;
let (padded, pitch) = pad_rgba_rows(&[255; 2 * 2 * 4], 2);
assert_eq!(pitch, 256);
assert_eq!(padded.len(), 2 * 256);