Last updated: 2026-06-12
Shader Dispatch
Runtime Assets
Runtime asset discovery for installed and source-tree ZINC layouts.
Release archives place shader assets next to the executable under `share/zinc/shaders`, while development builds often run from the repository with assets under `zig-out` or `src/shaders`. This module centralizes that lookup and keeps backend code from hardcoding source-checkout paths.
3 exports shown
enum
ShaderKind
pub const ShaderKind = enum Which compiled shader family to locate.
function
resolveShaderDir
pub fn resolveShaderDir(allocator: std.mem.Allocator, kind: ShaderKind) ![]u8 Resolve the directory holding compiled shaders of `kind`, honoring `ZINC_SHADER_DIR`.
Checks the `ZINC_SHADER_DIR` environment override first, then falls back to the executable-relative install layout and the in-tree development paths. or `error.ShaderDirNotFound` when no known layout exists.
function
resolveShaderDirFrom
pub fn resolveShaderDirFrom( allocator: std.mem.Allocator, base_dir: std.fs.Dir, exe_dir_override: ?[]const u8, kind: ShaderKind, ) ![]u8 Resolve the shader directory against explicit base/exe dirs — the testable core of `resolveShaderDir`.
Tries the executable-relative install layout first, then the working-directory candidates for the requested shader family.