Skip to content

Commit b75f7ea

Browse files
authored
Prepare release 0.11.0 (#145)
* Simplify renderdoc-sys/generated_bindings.sh * Regenerate renderdoc-sys/src/bindings.rs with bindgen 0.64.0 * Bump renderdoc-sys crate version to 1.0.0 It's high time for this crate to commit to a 1.x semantic versioning range. The likelihood this API will continue to churn is very low, and if it ever does, compatibility guarantees should be conveyed explicitly using the crate version number. * Improve renderdoc-sys documentation * Remove unused bindgen flags from generate_bindings.sh * Remove renderdoc-sys from workspace default members * Improve renderdoc crate documentation * Gracefully handle RenderDoc absence in triangle.rs example According to the upstream RenderDoc documentation, applications should not panic if RenderDoc isn't loaded. Instead, they should handle its absence gracefully and continue running. The `triangle.rs` example should demonstrate this usage clearly. We should update the `README.md` accordingly too, but considering a total rewrite of this library is coming very soon, it probably isn't worth investing too much time into that. * Bump renderdoc crate version to 0.11.0 * Update CHANGELOG.md * Update copyright year in license file
1 parent 18307f9 commit b75f7ea

File tree

11 files changed

+112
-54
lines changed

11 files changed

+112
-54
lines changed

CHANGELOG.md

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,22 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
77

88
## [Unreleased]
99

10+
## [0.11.0] - 2023-02-20
11+
12+
### Changed
13+
14+
* Update `renderdoc-sys` dependency to 1.0.0.
15+
* Update `float-cmp` dependency to 0.9.
16+
* Update optional `glutin` dependency to 0.30.
17+
* Update optional `winit` dependency to 0.28.
18+
* Improve crate-level documentation.
19+
20+
### Fixed
21+
22+
* Fix loading strategy of `renderdoc` library (PR #140).
23+
* Fix typo in `start_frame_capture` and `end_frame_capture` docs (PR #122).
24+
* Fix undefined behavior and crash in `get_capture` (PR #143).
25+
1026
## [0.10.1] - 2021-02-10
1127

1228
### Changed
@@ -211,7 +227,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
211227
* Type-safe version requests and downgrading.
212228
* Convenient conversions for `winit::VirtualKeyCode` into RenderDoc `InputButton`.
213229

214-
[Unreleased]: https://github.com/ebkalderon/renderdoc-rs/compare/v0.10.1...HEAD
230+
[Unreleased]: https://github.com/ebkalderon/renderdoc-rs/compare/v0.11.0...HEAD
231+
[0.11.0]: https://github.com/ebkalderon/renderdoc-rs/compare/v0.10.1...v0.11.0
215232
[0.10.1]: https://github.com/ebkalderon/renderdoc-rs/compare/v0.10.0...v0.10.1
216233
[0.10.0]: https://github.com/ebkalderon/renderdoc-rs/compare/v0.9.1...v0.10.0
217234
[0.9.1]: https://github.com/ebkalderon/renderdoc-rs/compare/v0.9.0...v0.9.1

Cargo.toml

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "renderdoc"
3-
version = "0.10.1"
3+
version = "0.11.0"
44
edition = "2018"
55
resolver = "2"
66
authors = ["Eyal Kalderon <ebkalderon@gmail.com>"]
@@ -10,14 +10,14 @@ homepage = "https://github.com/ebkalderon/renderdoc-rs"
1010
repository = "https://github.com/ebkalderon/renderdoc-rs"
1111
documentation = "https://docs.rs/renderdoc/"
1212
readme = "README.md"
13-
categories = ["rendering"]
14-
keywords = ["graphics", "profile", "renderdoc", "trace"]
13+
keywords = ["graphics", "profiling", "renderdoc", "tracing"]
14+
categories = ["development-tools::debugging", "rendering"]
1515

1616
[package.metadata.docs.rs]
1717
all-features = true
1818

1919
[badges]
20-
circle-ci = { repository = "ebkalderon/renderdoc-rs" }
20+
maintenance = { status = "actively-developed" }
2121

2222
[features]
2323
default = []
@@ -30,7 +30,7 @@ bitflags = "1.0"
3030
float-cmp = "0.9"
3131
libloading = "0.7"
3232
once_cell = "1.0"
33-
renderdoc-sys = { version = "0.7", path = "./renderdoc-sys" }
33+
renderdoc-sys = { version = "1.0.0", path = "./renderdoc-sys" }
3434

3535
glutin = { version = "0.30", optional = true }
3636
winit = { version = "0.28", optional = true }
@@ -47,4 +47,3 @@ winit = "0.28"
4747

4848
[workspace]
4949
members = [".", "renderdoc-sys"]
50-
default-members = [".", "renderdoc-sys"]

LICENSE-MIT

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Copyright (c) 2022 Eyal Kalderon
1+
Copyright (c) 2023 Eyal Kalderon
22

33
Permission is hereby granted, free of charge, to any
44
person obtaining a copy of this software and associated

README.md

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
[![Crates.io][crate-badge]][crate-url]
55
[![Documentation][docs-badge]][docs-url]
66

7-
[build-badge]: https://circleci.com/gh/ebkalderon/renderdoc-rs.svg?style=shield
8-
[build-url]: https://circleci.com/gh/ebkalderon/renderdoc-rs
7+
[build-badge]: https://github.com/ebkalderon/renderdoc-rs/actions/workflows/ci.yml/badge.svg
8+
[build-url]: https://github.com/ebkalderon/renderdoc-rs/actions
99
[crate-badge]: https://img.shields.io/crates/v/renderdoc.svg
1010
[crate-url]: https://crates.io/crates/renderdoc
1111
[docs-badge]: https://docs.rs/renderdoc/badge.svg
@@ -15,10 +15,15 @@ Rust bindings to [RenderDoc], a popular graphics debugger.
1515

1616
[RenderDoc]: https://renderdoc.org/
1717

18-
RenderDoc is a free and open source graphics debugging tool. RenderDoc allows
19-
game developers to take frame captures of their applications, replay them,
20-
examine the graphics pipeline state, and potentially identify nasty graphics
21-
bugs.
18+
RenderDoc is a free and open source debugger for real-time graphics providing
19+
quick and easy frame captures and detailed introspection of any application
20+
using [Vulkan], [Direct3D 11], [Direct3D 12], [OpenGL], and [OpenGL ES].
21+
22+
[Vulkan]: https://www.vulkan.org/
23+
[Direct3D 11]: https://learn.microsoft.com/en-us/windows/win32/direct3d11/atoc-dx-graphics-direct3d-11
24+
[Direct3D 12]: https://learn.microsoft.com/en-us/windows/win32/direct3d12/direct3d-12-graphics
25+
[OpenGL]: https://www.khronos.org/opengl/
26+
[OpenGL ES]: https://www.khronos.org/opengles/
2227

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

examples/triangle.rs

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,12 @@ async fn run(event_loop: EventLoop<()>, window: Window) {
3838
.await
3939
.expect("Failed to create device");
4040

41-
let mut rd: RenderDoc<V110> = RenderDoc::new().expect("RenderDoc is not running");
42-
rd.set_focus_toggle_keys(&[InputButton::F]);
43-
rd.set_capture_keys(&[InputButton::C]);
41+
let mut renderdoc: Result<RenderDoc<V110>, _> = RenderDoc::new();
42+
43+
if let Ok(rd) = renderdoc.as_mut() {
44+
rd.set_focus_toggle_keys(&[InputButton::F]);
45+
rd.set_capture_keys(&[InputButton::C]);
46+
}
4447

4548
// Load the shaders from disk
4649
let shader = device.create_shader_module(wgpu::ShaderModuleDescriptor {
@@ -119,9 +122,9 @@ async fn run(event_loop: EventLoop<()>, window: Window) {
119122
..
120123
},
121124
..
122-
} => match keycode {
123-
VirtualKeyCode::C => rd.trigger_capture(),
124-
VirtualKeyCode::R => match rd.launch_replay_ui(true, None) {
125+
} => match (keycode, renderdoc.as_mut()) {
126+
(VirtualKeyCode::C, Ok(rd)) => rd.trigger_capture(),
127+
(VirtualKeyCode::R, Ok(rd)) => match rd.launch_replay_ui(true, None) {
125128
Ok(pid) => println!("Launched replay UI (PID {pid})"),
126129
Err(e) => eprintln!("Failed to launch replay UI: {e}"),
127130
},

renderdoc-sys/Cargo.toml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
[package]
22
name = "renderdoc-sys"
3-
version = "0.7.1"
3+
version = "1.0.0"
44
authors = ["Eyal Kalderon <ebkalderon@gmail.com>"]
5-
description = "Raw FFI bindings to the RenderDoc API"
5+
description = "Low-level bindings to the RenderDoc API"
66
license = "MIT OR Apache-2.0"
77
homepage = "https://github.com/ebkalderon/renderdoc-rs/tree/master/renderdoc-sys"
88
repository = "https://github.com/ebkalderon/renderdoc-rs"
9-
documentation = "https://docs.rs/renderdoc-sys/"
9+
documentation = "https://docs.rs/renderdoc-sys"
1010
readme = "README.md"
11-
keywords = ["ffi", "renderdoc"]
12-
exclude = ["/vendor"]
11+
keywords = ["ffi", "graphics", "profiling", "renderdoc", "tracing"]
12+
categories = ["development-tools::debugging", "external-ffi-bindings", "rendering"]
1313

1414
[badges]
15-
circle-ci = { repository = "ebkalderon/renderdoc-rs" }
15+
maintenance = { status = "passively-maintained" }
1616

1717
[dependencies]

renderdoc-sys/README.md

Lines changed: 30 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,26 +4,44 @@
44
[![Crates.io][crate-badge]][crate-url]
55
[![Documentation][docs-badge]][docs-url]
66

7-
[build-badge]: https://circleci.com/gh/ebkalderon/renderdoc-rs.svg?style=shield
8-
[build-url]: https://circleci.com/gh/ebkalderon/renderdoc-rs/tree/master/renderdoc-sys
7+
[build-badge]: https://github.com/ebkalderon/renderdoc-rs/actions/workflows/ci.yml/badge.svg
8+
[build-url]: https://github.com/ebkalderon/renderdoc-rs/actions
99
[crate-badge]: https://img.shields.io/crates/v/renderdoc-sys.svg
1010
[crate-url]: https://crates.io/crates/renderdoc-sys
1111
[docs-badge]: https://docs.rs/renderdoc-sys/badge.svg
1212
[docs-url]: https://docs.rs/renderdoc-sys
1313

14-
Low-level Rust FFI bindings to [RenderDoc], a popular graphics debugger.
14+
Low-level bindings to the [RenderDoc] in-application API.
1515

1616
[RenderDoc]: https://renderdoc.org/
1717

18-
RenderDoc is a free and open source graphics debugging tool. RenderDoc allows
19-
game developers to take frame captures of their applications, replay them,
20-
examine the graphics pipeline state, and potentially identify nasty graphics
21-
bugs.
18+
RenderDoc is a free and open source debugger for real-time graphics that allows
19+
quick and easy frame captures and detailed introspection of any application
20+
using [Vulkan], [Direct3D 11], [Direct3D 12], [OpenGL], and [OpenGL ES].
2221

23-
These raw bindings are generated directly from the [renderdoc_app.h][header]
24-
file provided upstream. This crate does not provide nor dynamically link to the
25-
required `renderdoc.dll` or `librenderdoc.so` library itself; it only provides
26-
the FFI objects for the [in-application RenderDoc API][api].
22+
[Vulkan]: https://www.vulkan.org/
23+
[Direct3D 11]: https://learn.microsoft.com/en-us/windows/win32/direct3d11/atoc-dx-graphics-direct3d-11
24+
[Direct3D 12]: https://learn.microsoft.com/en-us/windows/win32/direct3d12/direct3d-12-graphics
25+
[OpenGL]: https://www.khronos.org/opengl/
26+
[OpenGL ES]: https://www.khronos.org/opengles/
2727

28-
[header]: https://github.com/baldurk/renderdoc/blob/v1.x/renderdoc/api/app/renderdoc_app.h
28+
These bindings are automatically generated from [`renderdoc_app.h`] with
29+
[`bindgen`]. This crate does not provide nor link to `renderdoc.dll` nor
30+
`librenderdoc.so` by itself; it only contains the FFI symbols. Refer to the
31+
upstream [In-Application API][api] documentation for correct usage details.
32+
33+
[`renderdoc_app.h`]: https://github.com/baldurk/renderdoc/blob/v1.x/renderdoc/api/app/renderdoc_app.h
34+
[bindgen]: https://github.com/rust-lang/rust-bindgen
2935
[api]: https://renderdoc.org/docs/in_application_api.html
36+
37+
For a safe wrapper, see the [`renderdoc`](https://docs.rs/renderdoc) crate.
38+
39+
## License
40+
41+
`renderdoc-sys` is free and open source software distributed under the terms of
42+
either the [MIT](LICENSE-MIT) or the [Apache 2.0](LICENSE-APACHE) license, at
43+
your option.
44+
45+
Unless you explicitly state otherwise, any contribution intentionally submitted
46+
for inclusion in the work by you, as defined in the Apache-2.0 license, shall be
47+
dual licensed as above, without any additional terms or conditions.

renderdoc-sys/generate_bindings.sh

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,29 +3,22 @@
33
# This script generates Rust bindings to the in-application Renderdoc API.
44
#
55
# Dependencies:
6-
# * bindgen
6+
# * bindgen (>=0.63.0)
77
# * curl
88

99
set -euo pipefail
1010

1111
readonly VERSION=v1.x
12-
readonly BASE_DIR="$(cd "$(dirname "$0")" && pwd)"
1312
readonly TEMP_DIR="$(mktemp -d "${TMPDIR:-/tmp}/renderdoc-rs.XXXXXXXXX")"
1413

1514
trap -- "rm -rf '${TEMP_DIR}'" EXIT
1615

17-
cd "${TEMP_DIR}" || exit 1
18-
19-
curl -LO "https://raw.githubusercontent.com/baldurk/renderdoc/${VERSION}/renderdoc/api/app/renderdoc_app.h"
16+
curl -o "${TEMP_DIR}/renderdoc_app.h" -L "https://raw.githubusercontent.com/baldurk/renderdoc/${VERSION}/renderdoc/api/app/renderdoc_app.h"
2017

2118
bindgen \
2219
--blocklist-type '__uint64_t|__uint32_t' \
2320
--allowlist-type 'RENDERDOC.*|pRENDERDOC.*' \
2421
--generate-inline-functions \
2522
--no-prepend-enum-name \
2623
--impl-debug \
27-
--impl-partialeq \
28-
--with-derive-partialeq \
29-
--with-derive-eq \
30-
--with-derive-hash \
31-
"${TEMP_DIR}/renderdoc_app.h" > "${BASE_DIR}/../src/bindings.rs"
24+
"${TEMP_DIR}/renderdoc_app.h" > ./src/bindings.rs

renderdoc-sys/src/bindings.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* automatically generated by rust-bindgen 0.63.0 */
1+
/* automatically generated by rust-bindgen 0.64.0 */
22

33
pub const eRENDERDOC_Option_AllowVSync: RENDERDOC_CaptureOption = 0;
44
pub const eRENDERDOC_Option_AllowFullscreen: RENDERDOC_CaptureOption = 1;

renderdoc-sys/src/lib.rs

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,25 @@
1-
//! Raw FFI bindings to the RenderDoc API.
1+
//! Low-level bindings to the [RenderDoc](https://renderdoc.org/) in-application API.
22
//!
3-
//! Refer to the [In-Application API][api] documentation for more details.
3+
//! RenderDoc is a free and open source debugger for real-time graphics providing quick and easy
4+
//! frame captures and detailed introspection of any application using [Vulkan], [Direct3D 11],
5+
//! [Direct3D 12], [OpenGL], and [OpenGL ES].
46
//!
7+
//! [Vulkan]: https://www.vulkan.org/
8+
//! [Direct3D 11]: https://learn.microsoft.com/en-us/windows/win32/direct3d11/atoc-dx-graphics-direct3d-11
9+
//! [Direct3D 12]: https://learn.microsoft.com/en-us/windows/win32/direct3d12/direct3d-12-graphics
10+
//! [OpenGL]: https://www.khronos.org/opengl/
11+
//! [OpenGL ES]: https://www.khronos.org/opengles/
12+
//!
13+
//! These bindings are automatically generated from [`renderdoc_app.h`] with [`bindgen`]. This
14+
//! crate does not provide nor link to the `renderdoc.dll` or `librenderdoc.so` libraries on its
15+
//! own; it only contains FFI symbols. Refer to the official [In-Application API][api]
16+
//! documentation for correct usage.
17+
//!
18+
//! [`renderdoc_app.h`]: https://github.com/baldurk/renderdoc/blob/v1.x/renderdoc/api/app/renderdoc_app.h
19+
//! [`bindgen`]: https://github.com/rust-lang/rust-bindgen
520
//! [api]: https://renderdoc.org/docs/in_application_api.html
21+
//!
22+
//! For a safe wrapper, see the [`renderdoc`](https://docs.rs/renderdoc) crate.
623
724
#![allow(non_camel_case_types)]
825
#![allow(non_snake_case)]

0 commit comments

Comments
 (0)