AO.
DE

Overview

Project atlas · V, Vulkan, and OpenCL

Two connected project paths: hardware-accelerated video with Vulkan and portable compute with OpenCL, each traced from API generation to a working application.

Two paths from specifications to running GPU applications

Small repositories separate API generation, data formats, memory, interface, and application code. The Vulkan Video path plays H.264; the OpenCL path computes and visualizes particles together with Vulkan.

Vulkan Video · MP4 to screen output

OpenCL · registry to Vulkan interop

v_vulkan_video

Video playback directly on the GPU

An H.264/AVC MP4 player written in V that decodes through Vulkan Video, selects a compatible GPU, and handles presentation, resizing, and looping.

01

Input

minimp4 reads the MP4 container. h264 interprets the stream and supplies metadata and picture order.

02

Decode

The Vulkan bindings expose the native API to V. The player checks the video profile and selects a compatible GPU.

03

Present

GLFW provides windowing and input, Dear ImGui supplies the interface, and VMA assists with GPU memory.

04

Orchestrate

v_vulkan_video combines parsing, GPU selection, decoding, timing, resizing, presentation, and looping.

opencl

Bring compute and graphics together on one GPU

Generated OpenCL 1.0–3.0 bindings for V, typed helpers for buffers, images, and SVM, plus a particle system in which OpenCL and Vulkan share memory and synchronization.

01

Generate

v_opencl_bindings reads the canonical Khronos registry and produces traceable V bindings for OpenCL 1.0 through 3.0.

02

Use safely

opencl keeps the complete low-level API and adds opt-in typed helpers for discovery, buffers, images, SVM, events, and lifecycles.

03

Validate portably

CI exercises runtime paths on Linux and ABI builds for macOS and Windows, covering GCC, Clang, MSVC, and TinyCC.

04

Connect APIs

The particle example combines OpenCL compute with Vulkan presentation, shares memory and semaphores when available, and falls back to host staging.

Why every part matters

A video player looks like one application. In practice it solves several very different problems, deliberately separated here into understandable and reusable projects.

minimp4

Find the video data

An MP4 file is a container. minimp4 locates pictures, timing, and technical metadata inside it—much like a table of contents.

h264

Understand the compressed pictures

H.264 usually stores changes relative to other pictures. This project reads the rules, dependencies, and ordering needed to reconstruct them.

v_vulkan_bindings + vulkan

Translate between V and the graphics driver

Vulkan is the language of the GPU. The generator keeps thousands of definitions current; the bindings expose them reproducibly to V.

vulkan_memory_allocator

Manage scarce GPU memory

Video pictures are large and must live in the right place. VMA removes much of the error-prone memory bookkeeping from the application.

glfw + imgui

Make the result usable

GLFW connects windows, screens, and input. ImGui supplies controls and diagnostic interfaces, turning a pipeline into an operable program.

v_vulkan_video

Orchestrate the whole system

The player coordinates file access, timing, reference pictures, GPU queues, presentation, and window changes into visible video.

opencl

Make compute manageable

The complete bindings stay accessible while an optional ownership and type layer simplifies buffers, images, SVM, events, and kernel calls.

v_opencl_bindings

Keep the API reproducible

The generator ties its output to fixed Khronos inputs and validates the generated surface across several platforms and compilers.

v_imgui_examples

Show the integration compactly

A tested example connects V, Vulkan, GLFW, and Dear ImGui as a short path into the graphics toolchain.

One picture through the structure chain

For technical readers: one H.264 picture is not “displayed” with a single call. Metadata, reference pictures, GPU resources, and synchronization are described through a linked chain of Vulkan structures.

  1. StdVideoDecodeH264PictureInfo

    Picture number, SPS/PPS IDs, Picture Order Count, and flags describe the H.264 picture independently of Vulkan resources.

  2. VideoDecodeH264PictureInfoKHR → pNext

    Adds slice count and offsets, then attaches the codec-specific description to the general decode structure through pNext.

  3. StdVideoDecodeH264ReferenceInfo

    Describes every older reference picture on which P- or B-pictures depend. Without this history, the GPU cannot reconstruct the current picture.

  4. VideoDecodeH264DpbSlotInfoKHR → VideoReferenceSlotInfoKHR

    Connects H.264 reference data to a Decoded Picture Buffer slot and its concrete image resource.

  5. VideoPictureResourceInfoKHR

    Points through imageViewBinding to the GPU image and states its coded extent and array layer—the physical destination or reference storage.

  6. VideoBeginCodingInfoKHR

    Opens the video coding scope with the session, session parameters, and active reference slots. An optional session reset follows.

  7. VideoDecodeInfoKHR → vkCmdDecodeVideoKHR

    Collects the bitstream buffer and byte range, destination picture, current DPB slot, and every reference slot. Only now is the decode command recorded.

  8. ImageMemoryBarrier2 + semaphore

    Barriers transfer image layout and ownership between video and graphics queues; a semaphore prevents graphics from reading an unfinished picture.

  9. SubmitInfo → draw → PresentInfoKHR

    The video queue produces the picture, the graphics queue draws it into a swapchain image, and vkQueuePresentKHR hands that image to the display.

minimp4V · MP4 containerh264V · H.264vulkanV · Vulkan APIv_vulkan_bindingsV · Code generationimguiV · Dear ImGui · C++glfwV · GLFW · Windowingvulkan_memory_allocatorV · GPU memoryopenclV · OpenCL 1.0–3.0v_opencl_bindingsV · OpenCL code generationv_imgui_examplesV · Vulkan · Dear ImGui