#amd #marker #gpu #instrumentation #bindings #profiler #direct-x12

amd-ext-d3d

Rust bindings for AMD's DirectX12 modified PIX3 RGP markers

6 releases

0.3.1 Jul 14, 2024
0.3.0 Jun 28, 2024
0.2.1 Nov 17, 2023
0.2.0 Aug 26, 2023
0.1.0 May 25, 2023

#195 in Graphics APIs

Download history 30/week @ 2024-07-22 10/week @ 2024-07-29 6/week @ 2024-08-05 13/week @ 2024-08-12 20/week @ 2024-08-19 29/week @ 2024-09-02 9/week @ 2024-09-09 22/week @ 2024-09-16 62/week @ 2024-09-23 40/week @ 2024-09-30 13/week @ 2024-10-07 64/week @ 2024-10-14 54/week @ 2024-10-21 53/week @ 2024-10-28 38/week @ 2024-11-04

210 downloads per month

MIT license

17KB
289 lines

Rust bindings for AMD's DirectX12 RGP markers

Actions Status Latest version Documentation Lines of code MIT Contributor Covenant

Banner

Call AMD's command list markers directly in Rust for event instrumentation in Radeon GPU Profiler, as well as other functionality provided on IAmdExtD3DDevice1.

Usage

Add this to your Cargo.toml:

[dependencies]
amd-ext-d3d = "0.3.1"

While upstream documentation details how to embed these calls into existing PIX3 markers (behind a C #derive), you get to call them explicitly in Rust:

use amd_ext_d3d::AmdExtD3DDevice;
use std::ffi::CStr;
use windows::Win32::Graphics::Direct3D12::{ID3D12Device, ID3D12GraphicsCommandList};


let device: ID3D12Device = todo!("Open DirectX12 graphics device");
let cmd_list: ID3D12GraphicsCommandList = todo!("device.CreateCommandList(...)");

// Load the extension
let amd_device = unsafe { AmdExtD3DDevice::new(device.into()) }.unwrap();

let name = CStr::from_bytes_with_nul(b"My super cool GPU event!\0").unwrap();
unsafe { amd_device.push_marker(&cmd_list, name) };
// Submit work to the GPU...
unsafe { amd_device.pop_marker(&cmd_list) };

Contributing

See CONTRIBUTING.md for details on regenerating the metadata and Rust code from upstream headers.

Dependencies

~127MB
~2M SLoC