Rust · Slang · Metal · WebGPU

One engine for desktop UI, 2D/3D games, and streamed worlds.

Xodó is Bizu's open-source Cargo workspace: a shared GPU device graph, a retained 2D/2.5D/3D stage, optional world capabilities, and a hardware-accelerated UI toolkit.

Xodó Buddy Xodó Buddy

Overview

  • Xodó DocumentationA Rust runtime and renderer for desktop UI, 2D/2.5D/3D games, and streamed 3D worlds.
  • Getting StartedPrerequisites, building native/web/iOS targets, running tests and examples, and integrating Xodó with a host project.

Architecture

  • Workspace & Rust RulesCargo workspace layout, implementation rules, dependencies, generated shaders, and crate boundaries.
  • Device Layer & Render GraphTyped GPU handles, bind-group caching, ordered render graph, build-time Metal libraries, uploads, and backend rules.
  • Asset Source & LoadingAsynchronous byte source, providers, seekable packs, asset store, background workers, audio, and font loading.
  • Resource LifetimesWhat shared caches retain, how Arc and Weak leases work, and when unleased materials are evicted.

The Stage

  • Stage Overview & RendererRetained 2D/2.5D/3D scene model, cameras, ordering, culling, draw lists, StageRenderer, MSAA, and render scale.
  • Lighting, Shadows & Post-ProcessingClassic and PBR lighting, clustered local lights, shadow maps, HDR post chains, bloom, TAA, MetalFX, ray-traced shadows, and custom Slang materials.
  • Drawables, Helpers & DiagnosticsChunked tilemaps, particle emitters, world-space text, debug lines, sprite animation, FixedClock, image diffing, and GPU pass timing.
  • World CapabilitiesOptional stage capability crates for static regions, cells and portals, terrain, skeletal skinning, water, sky, fog, streaming, and converted assets.

UI Toolkit

  • UI ToolkitRetained flexbox tree, immediate 2D canvas shader, linear-light blending, HUD compositing, and HarfRust/FreeType text shaping.

Platforms

  • iOS PlatformBuilding Xodó for aarch64-apple-ios and aarch64-apple-ios-sim, static SDL3, lifecycle, shaders, and simulator samples.

Tools & Formats

  • Binary Formats & glTF ImportEngine binary asset formats, asset store layout, xodo-import glTF 2.0 converter, and build scripts.
  • Level Dump CLISchema-driven lossless JSON dump and reload for binary level files and Git textconv diffs.

Reference

  • Material Device CapabilitiesCapability record consumed by the material compiler, stage limits, and explicit device definitions.
  • Vertex Data PreparationOrder-preserving vertex fetch remapping, split position/attribute streams, and quantization error bounds.

Contracts

  • Rendering ContractsBinding architectural contracts for colour, baked lighting, materials, precision, and streaming across Metal and WebGPU.
  • Colour ContractSeparating authored colour math from linear light transport, exposure ownership, and explicit UI/output encoding (C1–C4).
  • Baked-Lighting ContractReceiver lighting provenance, replacing inseparable legacy bakes, and visibility/portability rules (B1–B3).
  • Materials ContractSemantic material representation, logical texture references, portable sampler rules, and blend ordering (M1–M4).
  • Precision ContractCamera-relative double-precision placement, reverse-Z depth, 32-bit GPU IDs, and shared 16-byte shader ABI.
  • Streaming ContractAsynchronous asset source interface, pending policies by class, gameplay pin gates, and residency budgets.

Xodó

Xodó is Bizu's open-source Cargo workspace for desktop UI, 2D/2.5D/3D games, and streamed 3D worlds: a shared GPU device graph with Metal (macOS, iOS) and WebGPU (browser via Emscripten) backends, a retained 2D/2.5D/3D stage, a world runtime, and a hardware-accelerated UI toolkit. Shaders are written once in Slang, and SDL3 handles windows, input, and audio.

Game rules, networking, and session state belong to the hosts built on Xodó.

Highlights

Crate Map

Every module is a workspace crate in Cargo.toml. The top-level engine facade crate re-exports the core runtime and UI crates (engine::assets, engine::render::device, etc.). Stage crates are opted into directly so unused stage code is never linked.

Core & Platform

CratePathResponsibility
engine-corecore/Value types, math, load profile and frame trace counters, FixedClock, dynamic resolution controller, RSA public power, and SHA-256
engine-platformplatform/SDL3 initialization, windows, cursors, BackgroundLoad, web file mounting, PNG helpers, and iOS app lifecycle
engine-render-devicerender/device/Device layer: typed resource handles, ordered render graph, and Metal / WebGPU backends (Device layer)
engine-audio-outputaudio/output/SDL3 playback device, Ogg Vorbis decoder, generic clip and streaming playback with fades, groups, ducking, and distance gain

Stage (2D / 2.5D / 3D Scene)

CratePathResponsibility
engine-stagestage/Headless CPU scene model: transforms, cameras, virtual resolutions, sprites, meshes, classic and PBR lights, shadows, MSAA, culling, picking, HDR post plans, tilemaps, particles, world-space text layout, and debug lines
engine-stage-renderstage/render/Draws stage draw lists through the device layer using Slang shaders, host custom materials, and engine-gfx glyph rasterization
engine-stage-assetsstage/assets/Reads converted .xmesh, .xskin, .ktx2, emitter, and material files into stage data
engine-stage-cellsstage/cells/Cell-and-portal visibility masks and point-to-cell queries for stage cameras and regions
engine-stage-levelsstage/levels/Loads converted levels, BSP geometry, terrain chunks and layers, decorations, sky, fog, simulated effects, and background streaming into the stage
engine-stage-materialsstage/materials/Built-in stage custom materials and post steps: compiled stage programs, terrain layers, water, physical sky, cube reflections, contact shadows, seabed caustics, and light shafts
engine-stage-skinningstage/skinning/CPU and GPU compute skeletal mesh skinning and animation blending for the stage

World Runtime & Data

CratePathResponsibility
engine-assetsassets/Binary asset formats (KTX2, meshes, skins, animations, emitters, catalogs, materials, levels), asset store, seekable packs, host profile, and async byte source
engine-scene-materialsscene/materials/Material graphs, stage compilation, texture animation, and procedural texture interfaces
engine-scenescene/Level data and loaders, lighting, particles, visibility, and material resolution
engine-scene-worldscene/world/Seamless world scene, collision, water, time of day, and cameras
engine-scene-pawnsscene/pawns/Skeletal animation, skinning, and pawn shadows
engine-renderrender/Metal ray tracing, light masks, CPU reference rasterizer, and video output
engine-audioaudio/Sound voices, sound library, and music / ambient players

UI Toolkit & Tools

CratePathResponsibility
engine-gfxgfx/2D UI renderer, interface font, FreeType-matched autofit hinter, and smooth glyph rasterizer
engine-uiui/Retained flexbox UI tree, immediate canvas, text shaping, SVG icons, input, and HUD compositing (UI toolkit)
engine-ui-viewui/view/Elm-style components on the retained tree: element builders, keyed reconciliation, story tests and headless behaviours (components)
engine-clicli/The xodo CLI for lossless JSON dumps of binary level files and back (Level dump)
engine-importimport/Build-time glTF 2.0 importer (xodo-import); never linked into a runtime (Formats & Import)
engine-image-diffimage_diff/Dev-dependency for RGBA8 capture comparison in tests

Guide Index