Performance markers for Microsoft's PIX profiler in Zig.
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2026-10-24 15:55:52 +01:00
.github/workflows Add build check for CI 2026-10-24 15:53:50 +01:00
src files from monorepo @ bde42aaeec763c1bd8781d26285b0f4dc65b1a4c 2024-11-04 21:19:24 +00:00
.gitignore files from monorepo @ bde42aaeec763c1bd8781d26285b0f4dc65b1a4c 2024-11-04 21:19:24 +00:00
build.zig update to Zig 0.17.0 2026-10-24 15:55:52 +01:00
build.zig.zon update to Zig 0.17.0 2026-10-24 15:55:52 +01:00
LICENSE files from monorepo @ bde42aaeec763c1bd8781d26285b0f4dc65b1a4c 2024-11-04 21:19:24 +00:00
README.md Update README.md 2024-11-04 21:20:15 +00:00

zpix

Performance markers for Microsoft's PIX profiler in Zig.

Getting started

Example build.zig:

pub fn build(b: *std.Build) void {
    const exe = b.addExecutable(.{ ... });

    const zpix = b.dependency("zpix", .{
        .enable = true,
        .path = @as([]const u8, ...folder containing WinPixGpuCapturer.dll, typically directory under C:\Program Files\\Microsoft PIX),
    });
    exe.root_module.addImport("zpix", zpix.module("root"));
}

Load GPU capture library before making any D3D12 calls:

const zpix = @import("zpix");

pub fn main() !void {
    const pix_library = try zpix.loadGpuCapturerLibrary();
    defer pix_library.deinit();
    ...
}

Then using the PIX UI:

  1. Under Select Target Process --> Attach
  2. Select process
  3. Select Attach
  4. Under GPU Capture, click on camera icon

Advanced usage

For programmic capture use beginCapture/endCapture.

If process has multiple windows, target one for GPU capture using setTargetWindow.

Full PIX documentation