ext "DRI3"

request Dri3QueryVersion = 0 (
    major_version: u32,
    minor_version: u32,
) {
    @pad 1,
    major_version: u32,
    minor_version: u32,
}

request Dri3Open = 1 (
    drawable: u32,
    provider: u32,
) {
    @pad 1,
    device_fd: fd,
    @pad 24,
}

request Dri3PixmapFromBuffer = 2 (
    pixmap: u32,
    drawable: u32,
    size: u32,
    width: u16,
    height: u16,
    stride: u16,
    depth: u8,
    bpp: u8,
    pixmap_fd: fd,
);

request Dri3PixmapFromBuffers = 7 (
    pixmap: u32,
    window: u32,
    num_buffers: u8,
    @pad 3,
    width: u16,
    height: u16,
    stride0: u32,
    offset0: u32,
    stride1: u32,
    offset1: u32,
    stride2: u32,
    offset2: u32,
    stride3: u32,
    offset3: u32,
    depth: u8,
    bpp: u8,
    @pad 2,
    modifier: u64,
    buffers: list(fd, field(num_buffers)),
);
