mirror of
https://github.com/gfx-rs/wgpu.git
synced 2026-04-22 03:02:01 -04:00
[rs] Merge #916
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:
@@ -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"
|
||||
|
||||
@@ -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));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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 = ();
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user