Skip to content

Commit

Permalink
Add support for 1.3.0 and 1.4.0 (#30)
Browse files Browse the repository at this point in the history
* Clean up renderdoc-sys crate, regenerate bindings

* Update glutin to 0.21, convert to workspace

* Improve Renderdoc compatibility and API ergonomics

* Remove generic type parameter from `GetApiFn` alias

* Fix improperly designed `launch_replay_ui()` method

* Add `CaptureOption::AllowUnsupportedVendorExtensions` variant

* Update test to reflect new default capture settings

* Reformat doc comments

* Update triangle example to latest glutin and gfx pre-ll

* Upgrade renderdoc-derive dependencies, minor perf optimizations

* Update Circle CI configuration to Rust 1.34.1

* Update copyright notices

* Reformat doc comments in src/api.rs

* Fix improperly designed set_capture_file_comments() method

* Remove unused lazy_static dependency

* Add embedded path for Android Renderdoc library

* Add entry points for API 1.3.0 and 1.4.0

* Update gen_bindings.sh to derive Eq, Hash, PartialEq

* Add RenderDocV130 and RenderDocV140 traits

* Implement traits, add downgrade paths for 1.3.0 and 1.4.0

* Reorder derives in alphabetical order

* Run bindgen tests for renderdoc-sys in CircleCI

* Update CHANGELOG.md
  • Loading branch information
ebkalderon authored May 18, 2019
1 parent c88a485 commit db2d562
Show file tree
Hide file tree
Showing 15 changed files with 880 additions and 764 deletions.
8 changes: 5 additions & 3 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ version: 2
jobs:
build:
docker:
- image: circleci/rust:1.33.0
- image: circleci/rust:1.34.1

environment:
TZ: "/usr/share/zoneinfo/Asia/Singapore"
Expand All @@ -15,7 +15,7 @@ jobs:
- run:
name: Check formatting
command: |
rustup component add rustfmt-preview
rustup component add rustfmt
cargo fmt -- --check
- run:
name: Nightly Build
Expand All @@ -32,7 +32,9 @@ jobs:
cargo build
- run:
name: Test
command: cargo test --no-run
command: |
cargo test --no-run
cargo test -p renderdoc-sys
- save_cache:
key: project-cache
paths:
Expand Down
16 changes: 14 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,26 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
## [Unreleased]
### Added
* Add CI and documentation badges.
* Implement support for API versions 1.3.0 and 1.4.0.
* Allow string slices with lifetimes in `set_capture_file_comments()`.

### Changed
* Bump `glutin` dependency to 0.21.
* Bump `gfx` dev-dependency to 0.18.1.
* Bump `gfx_window_glutin` dev-dependency to 0.31.
* Upgrade CircleCI Rust image to 1.34.1.
* Convert top-level crate to workspace.
* Clean up `renderdoc-sys` crate layout.
* Minor code formatting tweaks.
* Switch to Circle CI Rust 1.33.0 image.
* Switch to Circle CI Rust 1.34.1 image.

### Fixed
* Fix erroneous doc comments (PR #24).
* Unimplement `Clone`, `Send`, and `Sync` for `RenderDoc` (PR #29).
* Unimplement `Clone`, `Send`, and `Sync` for `RenderDoc` struct (PR #29).
* Correct default setting in the `get_set_capture_option()` unit test.
* Fix improperly designed `launch_replay_ui()` method, update `triangle` example
to match.
* Set correct RenderDoc library path for Android clients.

## [0.4.0] - 2018-09-16
### Added
Expand Down
14 changes: 9 additions & 5 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,19 @@ bitflags = "1.0"
lazy_static = "1.0"
renderdoc-derive = { version = "0.4.0", path = "./renderdoc-derive" }
renderdoc-sys = { version = "0.4.0", path = "./renderdoc-sys" }
libloading = "0.5.0"
libloading = "0.5"

glutin = { version = "0.18", optional = true }
glutin = { version = "0.21", optional = true }

[target.'cfg(windows)'.dependencies]
winapi = { version = "0.3", features = ["d3d12","d3d11"] }
wio = "0.2"

[dev-dependencies]
gfx = "0.17"
gfx_window_glutin = "0.26"
glutin = "0.18"
gfx = "0.18.1"
gfx_window_glutin = "0.31"
glutin = "0.21"

[workspace]
members = [".", "renderdoc-derive", "renderdoc-sys"]
default-members = [".", "renderdoc-sys"]
2 changes: 1 addition & 1 deletion LICENSE-MIT
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2017-2018 Eyal Kalderon
Copyright (c) 2017-2019 Eyal Kalderon

Permission is hereby granted, free of charge, to any
person obtaining a copy of this software and associated
Expand Down
19 changes: 12 additions & 7 deletions examples/triangle.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Copyright 2017-2019 Eyal Kalderon
// Copyright 2015 The Gfx-rs Developers.
//
// Licensed under the Apache License, Version 2.0 (the "License");
Expand All @@ -20,9 +21,9 @@ extern crate renderdoc;

use gfx::traits::FactoryExt;
use gfx::Device;
use glutin::{GlContext, GlProfile};
use glutin::GlProfile;
use renderdoc::prelude::*;
use renderdoc::{OverlayBits, RenderDoc, V110};
use renderdoc::{RenderDoc, V110};

pub type ColorFormat = gfx::format::Rgba8;
pub type DepthFormat = gfx::format::DepthStencil;
Expand Down Expand Up @@ -66,8 +67,11 @@ pub fn main() {
let context = glutin::ContextBuilder::new()
.with_vsync(true)
.with_gl_profile(GlProfile::Core);

let (window, mut device, mut factory, main_color, mut main_depth) =
gfx_window_glutin::init::<ColorFormat, DepthFormat>(window_config, context, &events_loop);
gfx_window_glutin::init::<ColorFormat, DepthFormat>(window_config, context, &events_loop)
.unwrap();

let mut encoder: gfx::Encoder<_, _> = factory.create_command_buffer().into();
let pso = factory
.create_pipeline_simple(
Expand All @@ -82,10 +86,11 @@ pub fn main() {
out: main_color,
};

rd.set_active_window(window.context(), ::std::ptr::null());
rd.set_active_window(window.context(), std::ptr::null());;
rd.set_focus_toggle_keys(&[glutin::VirtualKeyCode::F]);
rd.set_capture_keys(&[glutin::VirtualKeyCode::C]);
rd.mask_overlay_bits(OverlayBits::DEFAULT, OverlayBits::DEFAULT);
rd.set_capture_option_u32(renderdoc::CaptureOption::AllowVSync, 1);
rd.set_capture_option_u32(renderdoc::CaptureOption::ApiValidation, 1);

let mut running = true;
while running {
Expand All @@ -100,7 +105,7 @@ pub fn main() {
..
},
..
} => match rd.launch_replay_ui("thing") {
} => match rd.launch_replay_ui(true, None) {
Ok(pid) => println!("Launched replay UI ({}).", pid),
Err(err) => eprintln!("{:?}", err),
},
Expand All @@ -114,7 +119,7 @@ pub fn main() {
}
| glutin::WindowEvent::CloseRequested => running = false,
glutin::WindowEvent::Resized(logical_size) => {
let dpi_factor = window.get_hidpi_factor();
let dpi_factor = window.window().get_hidpi_factor();
window.resize(logical_size.to_physical(dpi_factor));
gfx_window_glutin::update_views(&window, &mut data.out, &mut main_depth);
}
Expand Down
6 changes: 3 additions & 3 deletions renderdoc-derive/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@ circle-ci = { repository = "ebkalderon/renderdoc-rs" }
proc-macro = true

[dependencies]
proc-macro2 = "0.4.19"
quote = "0.6.8"
syn = "0.15.4"
proc-macro2 = "0.4.30"
quote = "0.6.12"
syn = "0.15.34"
9 changes: 4 additions & 5 deletions renderdoc-derive/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,15 +54,14 @@ fn impl_renderdoc(ast: &DeriveInput) -> TokenStream {
/// Each API version in this list is a unique identifier of the form `V100`, `V110`, `V120`, etc.
fn build_api_list(attrs: &[Attribute]) -> Vec<Ident> {
let meta = attrs
.iter()
.into_iter()
.flat_map(|attr| attr.interpret_meta())
.find(|meta| meta.name() == "renderdoc_convert")
.expect("Missing required attribute `#[renderdoc_convert(...)]`");

let mut apis: Vec<Ident> = match meta {
Meta::List(MetaList { ref nested, .. }) => nested
.iter()
.cloned()
Meta::List(MetaList { nested, .. }) => nested
.into_iter()
.flat_map(|elem| match elem {
NestedMeta::Meta(Meta::Word(ident)) => Some(ident),
_ => None,
Expand Down Expand Up @@ -188,7 +187,7 @@ fn gen_renderdoc_impls(name: &Ident, apis: &[Ident], tokens: TokenStream2) -> To
&format!("entry_{}", api.to_string().to_lowercase()),
span.clone(),
);
let ret_val = Ident::new(&format!("Entry{}", api), span.clone());
let ret_val = Ident::new(&format!("Entry{}", api), span);

quote! {
impl ::api::#trait_name for #name<#version> {
Expand Down
7 changes: 0 additions & 7 deletions renderdoc-sys/generate.sh

This file was deleted.

Loading

0 comments on commit db2d562

Please sign in to comment.