Skip to content

Performance markers for Microsoft's PIX profiler in Zig.

License

Notifications You must be signed in to change notification settings

zig-gamedev/zpix

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Performance markers for Microsoft's PIX profiler in Zig.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages