File tree Expand file tree Collapse file tree 3 files changed +39
-1
lines changed Expand file tree Collapse file tree 3 files changed +39
-1
lines changed Original file line number Diff line number Diff line change @@ -37,6 +37,8 @@ import {
37
37
GPUTextureView ,
38
38
GPUExternalTexture ,
39
39
op_create_gpu ,
40
+ op_webgpu_device_start_capture ,
41
+ op_webgpu_device_stop_capture ,
40
42
} from "ext:core/ops" ;
41
43
const {
42
44
ObjectDefineProperty,
@@ -884,6 +886,19 @@ webidl.converters["GPUUncapturedErrorEventInit"] = webidl
884
886
dictMembersGPUUncapturedErrorEventInit ,
885
887
) ;
886
888
889
+ function deviceStartCapture ( device ) {
890
+ op_webgpu_device_start_capture ( device ) ;
891
+ }
892
+
893
+ function deviceStopCapture ( device ) {
894
+ op_webgpu_device_stop_capture ( device ) ;
895
+ }
896
+
897
+ const denoNsWebGPU = {
898
+ deviceStartCapture,
899
+ deviceStopCapture,
900
+ } ;
901
+
887
902
let gpu ;
888
903
function initGPU ( ) {
889
904
if ( ! gpu ) {
@@ -896,6 +911,7 @@ function initGPU() {
896
911
}
897
912
898
913
export {
914
+ denoNsWebGPU ,
899
915
GPU ,
900
916
gpu ,
901
917
GPUAdapter ,
Original file line number Diff line number Diff line change @@ -917,3 +917,21 @@ impl GPUDeviceLostInfo {
917
917
"device was lost"
918
918
}
919
919
}
920
+
921
+ #[ op2( fast) ]
922
+ pub fn op_webgpu_device_start_capture ( #[ cppgc] device : & GPUDevice ) {
923
+ unsafe {
924
+ device
925
+ . instance
926
+ . device_start_graphics_debugger_capture ( device. id ) ;
927
+ }
928
+ }
929
+
930
+ #[ op2( fast) ]
931
+ pub fn op_webgpu_device_stop_capture ( #[ cppgc] device : & GPUDevice ) {
932
+ unsafe {
933
+ device
934
+ . instance
935
+ . device_stop_graphics_debugger_capture ( device. id ) ;
936
+ }
937
+ }
Original file line number Diff line number Diff line change @@ -64,7 +64,11 @@ pub type Instance = Arc<wgpu_core::global::Global>;
64
64
deno_core:: extension!(
65
65
deno_webgpu,
66
66
deps = [ deno_webidl, deno_web] ,
67
- ops = [ op_create_gpu] ,
67
+ ops = [
68
+ op_create_gpu,
69
+ device:: op_webgpu_device_start_capture,
70
+ device:: op_webgpu_device_stop_capture,
71
+ ] ,
68
72
objects = [
69
73
GPU ,
70
74
adapter:: GPUAdapter ,
You can’t perform that action at this time.
0 commit comments