Skip to content

Instantly share code, notes, and snippets.

View mxpv's full-sized avatar
🌴
On vacation

Maksym Pavlenko mxpv

🌴
On vacation
View GitHub Profile
@Ipotrick
Ipotrick / Efficient GPU Work Expansion.md
Last active July 11, 2025 16:13
Efficient GPU Work Expansion

What is "Work Expansion"

In a GPU-driven renderer, "work expansion" is a commonly occurring problem. "Work Expansion" means that a single item of work spawns N following work items. Typically one work item will be executed by one shader thread/invocation.

An example for work expansion is gpu driven meshlet culling following mesh culling. In this example a "work item" is culling a mesh, where each mesh cull work item spawns N following meshlet cull work items.

There are many diverse cases of this problem and many solutions. Some are trivial to solve, for example, when N (how many work items are spawned) is fixed.

@alichraghi
alichraghi / zig-shaders.md
Last active June 12, 2026 06:34
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),