Move start/stop debugger capture out of Global

This commit is contained in:
Andy Leiserson authored and Teodor Tanasoaia committed 2025-10-30 13:52:58 +01:00
1 parent 73d1334ba3
commit c0cce5973c
2 files changed
+38 -14

No files matched your search

+10 -14
View File
@@ -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>> {
+28
View File
@@ -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 {