Skip to content

Instantly share code, notes, and snippets.

@alichraghi
alichraghi / zig-shaders.md
Last active September 2, 2025 11:43
Zig Shaders

What does it look like?

Here is a simple fragment shader with uniform buffers:

const std = @import("std");
const gpu = std.gpu;

const UBO = extern struct {
    object_color: @Vector(4, f32),
    light_color: @Vector(4, f32),
import pyparsing as pp
token = pp.Word(pp.alphanums + '_-.')
command = pp.OneOrMore(token)
separators = ['1>>', '2>>', '>>', '1>', '2>', '>', '<', '||',
'|', '&&', '&', ';']
separator = pp.oneOf(separators)