vulkane 0.5.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 optional GLSL/WGSL/HLSL→SPIR-V compilation via naga or shaderc. Supports Vulkan 1.2.175 onward — swap vk.xml and rebuild.
// A trivial compute shader: reads each u32 from a storage buffer and
// replaces it with its square (modulo 2^32).
//
// Used by the `compute_square` example to demonstrate the safe wrapper's
// shader / descriptor / pipeline / dispatch path.
//
// Compile with:
//   glslc -O square_buffer.comp -o square_buffer.spv
//
// The pre-compiled SPIR-V is checked into this directory so users don't need
// glslc to run the example. Regenerate after editing.

#version 450

// 64 invocations per workgroup along the X axis. The example dispatches
// `ceil(N / 64)` workgroups for an input of N elements.
layout(local_size_x = 64, local_size_y = 1, local_size_z = 1) in;

// One storage buffer at descriptor set 0, binding 0.
// std430 layout matches Rust's #[repr(C)] for u32 arrays.
layout(set = 0, binding = 0, std430) buffer Data {
    uint values[];
};

void main() {
    uint idx = gl_GlobalInvocationID.x;
    if (idx >= values.length()) {
        return;
    }
    uint v = values[idx];
    values[idx] = v * v;
}