https://github.com/zig-gamedev/zpix
Performance markers for Microsoft's PIX profiler in Zig.
https://github.com/zig-gamedev/zpix
gamedev graphics pix profiling zig
Last synced: 8 months ago
JSON representation
Performance markers for Microsoft's PIX profiler in Zig.
- Host: GitHub
- URL: https://github.com/zig-gamedev/zpix
- Owner: zig-gamedev
- License: mit
- Created: 2024-11-04T21:19:02.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-03-25T20:49:38.000Z (8 months ago)
- Last Synced: 2025-03-25T21:32:44.654Z (8 months ago)
- Topics: gamedev, graphics, pix, profiling, zig
- Language: Zig
- Homepage:
- Size: 8.79 KB
- Stars: 1
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# [zpix](https://github.com/zig-gamedev/zpix)
Performance markers for [Microsoft's PIX profiler](https://devblogs.microsoft.com/pix/documentation/) in Zig.
## Getting started
Example `build.zig`:
```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:
```zig
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](https://devblogs.microsoft.com/pix/programmatic-capture/) use `beginCapture`/`endCapture`.
If process has multiple windows, target one for GPU capture using `setTargetWindow`.
[Full PIX documentation](https://devblogs.microsoft.com/pix/documentation/)