1#[allow(deref_nullptr)]
2pub mod bindings {
3 use ispc_rt::ispc_module;
4 ispc_module!(kernel);
5 ispc_module!(kernel_astc);
6}
7
8pub mod astc;
9pub mod bc1;
10pub mod bc3;
11pub mod bc4;
12pub mod bc5;
13pub mod bc6h;
14pub mod bc7;
15pub mod etc1;
16
17#[derive(Debug, Copy, Clone)]
19pub struct Surface<'a, const COMPONENTS: usize> {
20 pub data: &'a [u8],
25 pub width: u32,
27 pub height: u32,
29 pub stride: u32,
32}
33
34pub type RgbaSurface<'a> = Surface<'a, 4>;
35pub type RgSurface<'a> = Surface<'a, 2>;
36pub type RSurface<'a> = Surface<'a, 1>;
37
38#[inline(always)]
39pub fn divide_up_by_multiple(val: u32, align: u32) -> u32 {
40 let mask: u32 = align - 1;
41 (val + mask) / align
42}