pub fn buffer_index( local_x: usize, local_y: usize, buffer_width: usize, ) -> usize
Calculate buffer index for interior coordinates (0-indexed).