mirror of
https://github.com/storytold/wgpu.git
synced 2026-11-19 14:01:08 +01:00
Move start/stop debugger capture out of Global
This commit is contained in:
1 parent
73d1334ba3
commit
c0cce5973c
2 files changed
+38
-14
No files matched your search
@@ -1845,14 +1845,12 @@ impl Global {
|
||||
///
|
||||
/// [api]: ../../wgpu/struct.Device.html#method.start_graphics_debugger_capture
|
||||
pub unsafe fn device_start_graphics_debugger_capture(&self, device_id: DeviceId) {
|
||||
api_log!("Device::start_graphics_debugger_capture");
|
||||
|
||||
let device = self.hub.devices.get(device_id);
|
||||
|
||||
if !device.is_valid() {
|
||||
return;
|
||||
unsafe {
|
||||
self.hub
|
||||
.devices
|
||||
.get(device_id)
|
||||
.start_graphics_debugger_capture();
|
||||
}
|
||||
unsafe { device.raw().start_graphics_debugger_capture() };
|
||||
}
|
||||
|
||||
/// # Safety
|
||||
@@ -1861,14 +1859,12 @@ impl Global {
|
||||
///
|
||||
/// [api]: ../../wgpu/struct.Device.html#method.stop_graphics_debugger_capture
|
||||
pub unsafe fn device_stop_graphics_debugger_capture(&self, device_id: DeviceId) {
|
||||
api_log!("Device::stop_graphics_debugger_capture");
|
||||
|
||||
let device = self.hub.devices.get(device_id);
|
||||
|
||||
if !device.is_valid() {
|
||||
return;
|
||||
unsafe {
|
||||
self.hub
|
||||
.devices
|
||||
.get(device_id)
|
||||
.stop_graphics_debugger_capture();
|
||||
}
|
||||
unsafe { device.raw().stop_graphics_debugger_capture() };
|
||||
}
|
||||
|
||||
pub fn pipeline_cache_get_data(&self, id: id::PipelineCacheId) -> Option<Vec<u8>> {
|
||||
|
||||
@@ -338,6 +338,34 @@ impl Device {
|
||||
Err(MissingDownlevelFlags(flags))
|
||||
}
|
||||
}
|
||||
|
||||
/// # Safety
|
||||
///
|
||||
/// - See [wgpu::Device::start_graphics_debugger_capture][api] for details the safety.
|
||||
///
|
||||
/// [api]: ../../wgpu/struct.Device.html#method.start_graphics_debugger_capture
|
||||
pub unsafe fn start_graphics_debugger_capture(&self) {
|
||||
api_log!("Device::start_graphics_debugger_capture");
|
||||
|
||||
if !self.is_valid() {
|
||||
return;
|
||||
}
|
||||
unsafe { self.raw().start_graphics_debugger_capture() };
|
||||
}
|
||||
|
||||
/// # Safety
|
||||
///
|
||||
/// - See [wgpu::Device::stop_graphics_debugger_capture][api] for details the safety.
|
||||
///
|
||||
/// [api]: ../../wgpu/struct.Device.html#method.stop_graphics_debugger_capture
|
||||
pub unsafe fn stop_graphics_debugger_capture(&self) {
|
||||
api_log!("Device::stop_graphics_debugger_capture");
|
||||
|
||||
if !self.is_valid() {
|
||||
return;
|
||||
}
|
||||
unsafe { self.raw().stop_graphics_debugger_capture() };
|
||||
}
|
||||
}
|
||||
|
||||
impl Device {
|
||||
|
||||
Reference in new issue
Block a user