916: Update capture API r=kvark a=kvark

Picks up https://github.com/gfx-rs/wgpu/pull/1401

Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
This commit is contained in:
bors[bot]
2021-05-19 15:42:02 +00:00
committed by GitHub
4 changed files with 13 additions and 27 deletions

View File

@@ -26,20 +26,20 @@ cross = ["wgc/cross"]
[target.'cfg(not(target_arch = "wasm32"))'.dependencies.wgc]
package = "wgpu-core"
git = "https://github.com/gfx-rs/wgpu"
rev = "53eab747a32414232be45d47cae8a43a369395d0"
rev = "7ce535cc97958d8e224247764f3d57c162594504"
features = ["raw-window-handle"]
[target.'cfg(target_arch = "wasm32")'.dependencies.wgc]
package = "wgpu-core"
git = "https://github.com/gfx-rs/wgpu"
rev = "53eab747a32414232be45d47cae8a43a369395d0"
rev = "7ce535cc97958d8e224247764f3d57c162594504"
features = ["raw-window-handle"]
optional = true
[dependencies.wgt]
package = "wgpu-types"
git = "https://github.com/gfx-rs/wgpu"
rev = "53eab747a32414232be45d47cae8a43a369395d0"
rev = "7ce535cc97958d8e224247764f3d57c162594504"
[dependencies]
arrayvec = "0.5"

View File

@@ -1897,26 +1897,14 @@ impl crate::Context for Context {
}
}
fn start_capture(&self, device: &Self::DeviceId) {
fn device_start_capture(&self, device: &Self::DeviceId) {
let global = &self.0;
let res = wgc::gfx_select!(device.id => global.start_capture(device.id));
match res {
Ok(v) => v,
Err(cause) => {
self.handle_error_fatal(cause, "Device::start_capture");
}
}
wgc::gfx_select!(device.id => global.device_start_capture(device.id));
}
fn stop_capture(&self, device: &Self::DeviceId) {
fn device_stop_capture(&self, device: &Self::DeviceId) {
let global = &self.0;
let res = wgc::gfx_select!(device.id => global.stop_capture(device.id));
match res {
Ok(v) => v,
Err(cause) => {
self.handle_error_fatal(cause, "Device::stop_capture");
}
}
wgc::gfx_select!(device.id => global.device_stop_capture(device.id));
}
}

View File

@@ -2026,9 +2026,8 @@ impl crate::Context for Context {
1.0 //TODO
}
fn start_capture(&self, device: &Self::DeviceId) {}
fn stop_capture(&self, device: &Self::DeviceId) {}
fn device_start_capture(&self, _device: &Self::DeviceId) {}
fn device_stop_capture(&self, _device: &Self::DeviceId) {}
}
pub(crate) type SwapChainOutputDetail = ();

View File

@@ -448,9 +448,8 @@ trait Context: Debug + Send + Sized + Sync {
);
fn queue_get_timestamp_period(&self, queue: &Self::QueueId) -> f32;
fn start_capture(&self, device: &Self::DeviceId);
fn stop_capture(&self, device: &Self::DeviceId);
fn device_start_capture(&self, device: &Self::DeviceId);
fn device_stop_capture(&self, device: &Self::DeviceId);
}
/// Context for all other wgpu objects. Instance of wgpu.
@@ -1667,12 +1666,12 @@ impl Device {
/// Starts frame capture.
pub fn start_capture(&self) {
Context::start_capture(&*self.context, &self.id)
Context::device_start_capture(&*self.context, &self.id)
}
/// Stops frame capture.
pub fn stop_capture(&self) {
Context::stop_capture(&*self.context, &self.id)
Context::device_stop_capture(&*self.context, &self.id)
}
}