17 releases (11 breaking)

0.12.1 Mar 2, 2024
0.11.0 Feb 21, 2023
0.10.1 Feb 10, 2021
0.10.0 Dec 17, 2020
0.1.0 Oct 12, 2017

#13 in Rendering

Download history 633/week @ 2023-12-06 777/week @ 2023-12-13 659/week @ 2023-12-20 317/week @ 2023-12-27 600/week @ 2024-01-03 983/week @ 2024-01-10 864/week @ 2024-01-17 917/week @ 2024-01-24 900/week @ 2024-01-31 781/week @ 2024-02-07 1208/week @ 2024-02-14 1383/week @ 2024-02-21 1807/week @ 2024-02-28 1214/week @ 2024-03-06 1261/week @ 2024-03-13 1040/week @ 2024-03-20

5,600 downloads per month
Used in 4 crates

MIT/Apache

94KB
1.5K SLoC

renderdoc-rs

Build Status Crates.io Documentation

Rust bindings to RenderDoc, a popular graphics debugger.

RenderDoc is a free and open source debugger for real-time graphics providing quick and easy frame captures and detailed introspection of any application using Vulkan, Direct3D 11, Direct3D 12, OpenGL, and OpenGL ES.

These bindings require that RenderDoc be installed on the target machine, with either renderdoc.dll or librenderdoc.so visible from your $PATH.

For more details on how to use this API to integrate your game or renderer with the RenderDoc profiler, consult the in-application API documentation.

Example

use renderdoc::{RenderDoc, V100, V110};

fn main() {
    let mut rd: RenderDoc<V110> = RenderDoc::new().expect("Unable to connect");

    let (major, minor, patch) = rd.get_api_version();
    assert_eq!(major, 1u32);
    assert!(minor >= 1u32);

    // When a certain key is pressed, trigger a single-frame capture like this.
    rd.trigger_capture();

    // If you specify version `V110` or newer, you can trigger a multi-frame
    // capture like this.
    rd.trigger_multi_frame_capture(3);

    // Query the details of an existing capture like this.
    match rd.get_capture(0) {
        Some((path, capture_time)) => println!("ID: 0, Path: {}, Captured: {:?}", path, capture_time),
        None => println!("No capture found with ID of 0!"),
    }

    // Downgrade your effective API version at run-time like this.
    let mut rd: RenderDoc<V100> = rd.into();

    // Now this line will no longer compile!
    // rd.trigger_multi_frame_capture(3);
}

Working examples are available in the examples directory.

License

renderdoc-rs is free and open source software distributed under the terms of either the MIT or the Apache 2.0 license, at your option.

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Dependencies

~0.3–14MB
~128K SLoC