| Crates.io | amd-ext-d3d |
| lib.rs | amd-ext-d3d |
| version | 0.3.1 |
| created_at | 2023-05-25 09:43:54.451958+00 |
| updated_at | 2024-07-14 19:30:14.852299+00 |
| description | Rust bindings for AMD's DirectX12 modified PIX3 RGP markers |
| homepage | https://traverseresearch.nl |
| repository | https://github.com/Traverse-Research/amd-ext-d3d-rs |
| max_upload_size | |
| id | 874171 |
| size | 17,805 |
Call AMD's command list markers directly in Rust for event instrumentation in Radeon GPU Profiler, as well as other functionality provided on IAmdExtD3DDevice1.
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) };
See CONTRIBUTING.md for details on regenerating the metadata and Rust code from upstream headers.