1#[allow(deref_nullptr)]
2pub mod bindings {
3 use ispc_rt::ispc_module;
4
5 ispc_module!(kernel);
6 ispc_module!(kernel_astc);
7}
8
9pub mod astc;
10pub mod bc1;
11pub mod bc3;
12pub mod bc4;
13pub mod bc5;
14pub mod bc6h;
15pub mod bc7;
16pub mod etc1;
17
18#[derive(Debug, Copy, Clone)]
19pub struct RgbaSurface<'a> {
20 pub data: &'a [u8],
21 pub width: u32,
22 pub height: u32,
23 pub stride: u32,
24}
25
26pub fn cal_block_count(
27 image_width: u32,
28 image_height: u32,
29 block_width: u32,
30 block_height: u32,
31) -> u32 {
32 ((image_width + block_width - 1) / block_width)
33 * ((image_height + block_height - 1) / block_height)
34}