vulkane 0.4.0

Vulkan API bindings generated entirely from vk.xml, with a complete safe RAII wrapper covering compute and graphics: instance/device/queue, buffer, image, sampler, render pass, framebuffer, graphics + compute pipelines, swapchain, a VMA-style sub-allocator with TLSF + linear pools and defragmentation, sync primitives (fences, binary + timeline semaphores, sync2 barriers), query pools, and an optional naga GLSL/WGSL→SPIR-V feature. Supports Vulkan 1.2.175 onward — swap vk.xml and rebuild.
//! Vulkan version utilities
//!
//! Version constants (VK_API_VERSION_1_0, etc.) and version manipulation
//! functions (vk_make_api_version, vk_api_version_major, etc.) are generated
//! from vk.xml and available via `crate::raw::bindings::*`.

use crate::raw::bindings::*;

/// Represents a Vulkan API version
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub struct Version {
    pub major: u32,
    pub minor: u32,
    pub patch: u32,
}

impl Version {
    pub fn new(major: u32, minor: u32, patch: u32) -> Self {
        Self {
            major,
            minor,
            patch,
        }
    }

    pub fn from_raw(version: u32) -> Self {
        Self {
            major: vk_api_version_major(version),
            minor: vk_api_version_minor(version),
            patch: vk_api_version_patch(version),
        }
    }

    pub fn to_raw(&self) -> u32 {
        vk_make_api_version(0, self.major, self.minor, self.patch)
    }
}