diff options
Diffstat (limited to 'runtime/ops/webgpu.rs')
-rw-r--r-- | runtime/ops/webgpu.rs | 160 |
1 files changed, 74 insertions, 86 deletions
diff --git a/runtime/ops/webgpu.rs b/runtime/ops/webgpu.rs index d48913ce8..55c6d1817 100644 --- a/runtime/ops/webgpu.rs +++ b/runtime/ops/webgpu.rs @@ -10,40 +10,28 @@ pub fn init(rt: &mut deno_core::JsRuntime) { state.put(Unstable(unstable)); } - super::reg_json_async( - rt, - "op_webgpu_request_adapter", - op_webgpu_request_adapter, - ); - super::reg_json_async( - rt, - "op_webgpu_request_device", - op_webgpu_request_device, - ); - super::reg_json_sync( - rt, - "op_webgpu_create_query_set", - op_webgpu_create_query_set, - ); + super::reg_async(rt, "op_webgpu_request_adapter", op_webgpu_request_adapter); + super::reg_async(rt, "op_webgpu_request_device", op_webgpu_request_device); + super::reg_sync(rt, "op_webgpu_create_query_set", op_webgpu_create_query_set); { // buffer - super::reg_json_sync( + super::reg_sync( rt, "op_webgpu_create_buffer", buffer::op_webgpu_create_buffer, ); - super::reg_json_async( + super::reg_async( rt, "op_webgpu_buffer_get_map_async", buffer::op_webgpu_buffer_get_map_async, ); - super::reg_json_sync( + super::reg_sync( rt, "op_webgpu_buffer_get_mapped_range", buffer::op_webgpu_buffer_get_mapped_range, ); - super::reg_json_sync( + super::reg_sync( rt, "op_webgpu_buffer_unmap", buffer::op_webgpu_buffer_unmap, @@ -51,12 +39,12 @@ pub fn init(rt: &mut deno_core::JsRuntime) { } { // texture - super::reg_json_sync( + super::reg_sync( rt, "op_webgpu_create_texture", texture::op_webgpu_create_texture, ); - super::reg_json_sync( + super::reg_sync( rt, "op_webgpu_create_texture_view", texture::op_webgpu_create_texture_view, @@ -64,7 +52,7 @@ pub fn init(rt: &mut deno_core::JsRuntime) { } { // sampler - super::reg_json_sync( + super::reg_sync( rt, "op_webgpu_create_sampler", sampler::op_webgpu_create_sampler, @@ -72,17 +60,17 @@ pub fn init(rt: &mut deno_core::JsRuntime) { } { // binding - super::reg_json_sync( + super::reg_sync( rt, "op_webgpu_create_bind_group_layout", binding::op_webgpu_create_bind_group_layout, ); - super::reg_json_sync( + super::reg_sync( rt, "op_webgpu_create_pipeline_layout", binding::op_webgpu_create_pipeline_layout, ); - super::reg_json_sync( + super::reg_sync( rt, "op_webgpu_create_bind_group", binding::op_webgpu_create_bind_group, @@ -90,22 +78,22 @@ pub fn init(rt: &mut deno_core::JsRuntime) { } { // pipeline - super::reg_json_sync( + super::reg_sync( rt, "op_webgpu_create_compute_pipeline", pipeline::op_webgpu_create_compute_pipeline, ); - super::reg_json_sync( + super::reg_sync( rt, "op_webgpu_compute_pipeline_get_bind_group_layout", pipeline::op_webgpu_compute_pipeline_get_bind_group_layout, ); - super::reg_json_sync( + super::reg_sync( rt, "op_webgpu_create_render_pipeline", pipeline::op_webgpu_create_render_pipeline, ); - super::reg_json_sync( + super::reg_sync( rt, "op_webgpu_render_pipeline_get_bind_group_layout", pipeline::op_webgpu_render_pipeline_get_bind_group_layout, @@ -113,67 +101,67 @@ pub fn init(rt: &mut deno_core::JsRuntime) { } { // command_encoder - super::reg_json_sync( + super::reg_sync( rt, "op_webgpu_create_command_encoder", command_encoder::op_webgpu_create_command_encoder, ); - super::reg_json_sync( + super::reg_sync( rt, "op_webgpu_command_encoder_begin_render_pass", command_encoder::op_webgpu_command_encoder_begin_render_pass, ); - super::reg_json_sync( + super::reg_sync( rt, "op_webgpu_command_encoder_begin_compute_pass", command_encoder::op_webgpu_command_encoder_begin_compute_pass, ); - super::reg_json_sync( + super::reg_sync( rt, "op_webgpu_command_encoder_copy_buffer_to_buffer", command_encoder::op_webgpu_command_encoder_copy_buffer_to_buffer, ); - super::reg_json_sync( + super::reg_sync( rt, "op_webgpu_command_encoder_copy_buffer_to_texture", command_encoder::op_webgpu_command_encoder_copy_buffer_to_texture, ); - super::reg_json_sync( + super::reg_sync( rt, "op_webgpu_command_encoder_copy_texture_to_buffer", command_encoder::op_webgpu_command_encoder_copy_texture_to_buffer, ); - super::reg_json_sync( + super::reg_sync( rt, "op_webgpu_command_encoder_copy_texture_to_texture", command_encoder::op_webgpu_command_encoder_copy_texture_to_texture, ); - super::reg_json_sync( + super::reg_sync( rt, "op_webgpu_command_encoder_push_debug_group", command_encoder::op_webgpu_command_encoder_push_debug_group, ); - super::reg_json_sync( + super::reg_sync( rt, "op_webgpu_command_encoder_pop_debug_group", command_encoder::op_webgpu_command_encoder_pop_debug_group, ); - super::reg_json_sync( + super::reg_sync( rt, "op_webgpu_command_encoder_insert_debug_marker", command_encoder::op_webgpu_command_encoder_insert_debug_marker, ); - super::reg_json_sync( + super::reg_sync( rt, "op_webgpu_command_encoder_write_timestamp", command_encoder::op_webgpu_command_encoder_write_timestamp, ); - super::reg_json_sync( + super::reg_sync( rt, "op_webgpu_command_encoder_resolve_query_set", command_encoder::op_webgpu_command_encoder_resolve_query_set, ); - super::reg_json_sync( + super::reg_sync( rt, "op_webgpu_command_encoder_finish", command_encoder::op_webgpu_command_encoder_finish, @@ -181,102 +169,102 @@ pub fn init(rt: &mut deno_core::JsRuntime) { } { // render_pass - super::reg_json_sync( + super::reg_sync( rt, "op_webgpu_render_pass_set_viewport", render_pass::op_webgpu_render_pass_set_viewport, ); - super::reg_json_sync( + super::reg_sync( rt, "op_webgpu_render_pass_set_scissor_rect", render_pass::op_webgpu_render_pass_set_scissor_rect, ); - super::reg_json_sync( + super::reg_sync( rt, "op_webgpu_render_pass_set_blend_color", render_pass::op_webgpu_render_pass_set_blend_color, ); - super::reg_json_sync( + super::reg_sync( rt, "op_webgpu_render_pass_set_stencil_reference", render_pass::op_webgpu_render_pass_set_stencil_reference, ); - super::reg_json_sync( + super::reg_sync( rt, "op_webgpu_render_pass_begin_pipeline_statistics_query", render_pass::op_webgpu_render_pass_begin_pipeline_statistics_query, ); - super::reg_json_sync( + super::reg_sync( rt, "op_webgpu_render_pass_end_pipeline_statistics_query", render_pass::op_webgpu_render_pass_end_pipeline_statistics_query, ); - super::reg_json_sync( + super::reg_sync( rt, "op_webgpu_render_pass_write_timestamp", render_pass::op_webgpu_render_pass_write_timestamp, ); - super::reg_json_sync( + super::reg_sync( rt, "op_webgpu_render_pass_execute_bundles", render_pass::op_webgpu_render_pass_execute_bundles, ); - super::reg_json_sync( + super::reg_sync( rt, "op_webgpu_render_pass_end_pass", render_pass::op_webgpu_render_pass_end_pass, ); - super::reg_json_sync( + super::reg_sync( rt, "op_webgpu_render_pass_set_bind_group", render_pass::op_webgpu_render_pass_set_bind_group, ); - super::reg_json_sync( + super::reg_sync( rt, "op_webgpu_render_pass_push_debug_group", render_pass::op_webgpu_render_pass_push_debug_group, ); - super::reg_json_sync( + super::reg_sync( rt, "op_webgpu_render_pass_pop_debug_group", render_pass::op_webgpu_render_pass_pop_debug_group, ); - super::reg_json_sync( + super::reg_sync( rt, "op_webgpu_render_pass_insert_debug_marker", render_pass::op_webgpu_render_pass_insert_debug_marker, ); - super::reg_json_sync( + super::reg_sync( rt, "op_webgpu_render_pass_set_pipeline", render_pass::op_webgpu_render_pass_set_pipeline, ); - super::reg_json_sync( + super::reg_sync( rt, "op_webgpu_render_pass_set_index_buffer", render_pass::op_webgpu_render_pass_set_index_buffer, ); - super::reg_json_sync( + super::reg_sync( rt, "op_webgpu_render_pass_set_vertex_buffer", render_pass::op_webgpu_render_pass_set_vertex_buffer, ); - super::reg_json_sync( + super::reg_sync( rt, "op_webgpu_render_pass_draw", render_pass::op_webgpu_render_pass_draw, ); - super::reg_json_sync( + super::reg_sync( rt, "op_webgpu_render_pass_draw_indexed", render_pass::op_webgpu_render_pass_draw_indexed, ); - super::reg_json_sync( + super::reg_sync( rt, "op_webgpu_render_pass_draw_indirect", render_pass::op_webgpu_render_pass_draw_indirect, ); - super::reg_json_sync( + super::reg_sync( rt, "op_webgpu_render_pass_draw_indexed_indirect", render_pass::op_webgpu_render_pass_draw_indexed_indirect, @@ -284,42 +272,42 @@ pub fn init(rt: &mut deno_core::JsRuntime) { } { // compute_pass - super::reg_json_sync( + super::reg_sync( rt, "op_webgpu_compute_pass_set_pipeline", compute_pass::op_webgpu_compute_pass_set_pipeline, ); - super::reg_json_sync( + super::reg_sync( rt, "op_webgpu_compute_pass_dispatch", compute_pass::op_webgpu_compute_pass_dispatch, ); - super::reg_json_sync( + super::reg_sync( rt, "op_webgpu_compute_pass_dispatch_indirect", compute_pass::op_webgpu_compute_pass_dispatch_indirect, ); - super::reg_json_sync( + super::reg_sync( rt, "op_webgpu_compute_pass_end_pass", compute_pass::op_webgpu_compute_pass_end_pass, ); - super::reg_json_sync( + super::reg_sync( rt, "op_webgpu_compute_pass_set_bind_group", compute_pass::op_webgpu_compute_pass_set_bind_group, ); - super::reg_json_sync( + super::reg_sync( rt, "op_webgpu_compute_pass_push_debug_group", compute_pass::op_webgpu_compute_pass_push_debug_group, ); - super::reg_json_sync( + super::reg_sync( rt, "op_webgpu_compute_pass_pop_debug_group", compute_pass::op_webgpu_compute_pass_pop_debug_group, ); - super::reg_json_sync( + super::reg_sync( rt, "op_webgpu_compute_pass_insert_debug_marker", compute_pass::op_webgpu_compute_pass_insert_debug_marker, @@ -327,62 +315,62 @@ pub fn init(rt: &mut deno_core::JsRuntime) { } { // bundle - super::reg_json_sync( + super::reg_sync( rt, "op_webgpu_create_render_bundle_encoder", bundle::op_webgpu_create_render_bundle_encoder, ); - super::reg_json_sync( + super::reg_sync( rt, "op_webgpu_render_bundle_encoder_finish", bundle::op_webgpu_render_bundle_encoder_finish, ); - super::reg_json_sync( + super::reg_sync( rt, "op_webgpu_render_bundle_encoder_set_bind_group", bundle::op_webgpu_render_bundle_encoder_set_bind_group, ); - super::reg_json_sync( + super::reg_sync( rt, "op_webgpu_render_bundle_encoder_push_debug_group", bundle::op_webgpu_render_bundle_encoder_push_debug_group, ); - super::reg_json_sync( + super::reg_sync( rt, "op_webgpu_render_bundle_encoder_pop_debug_group", bundle::op_webgpu_render_bundle_encoder_pop_debug_group, ); - super::reg_json_sync( + super::reg_sync( rt, "op_webgpu_render_bundle_encoder_insert_debug_marker", bundle::op_webgpu_render_bundle_encoder_insert_debug_marker, ); - super::reg_json_sync( + super::reg_sync( rt, "op_webgpu_render_bundle_encoder_set_pipeline", bundle::op_webgpu_render_bundle_encoder_set_pipeline, ); - super::reg_json_sync( + super::reg_sync( rt, "op_webgpu_render_bundle_encoder_set_index_buffer", bundle::op_webgpu_render_bundle_encoder_set_index_buffer, ); - super::reg_json_sync( + super::reg_sync( rt, "op_webgpu_render_bundle_encoder_set_vertex_buffer", bundle::op_webgpu_render_bundle_encoder_set_vertex_buffer, ); - super::reg_json_sync( + super::reg_sync( rt, "op_webgpu_render_bundle_encoder_draw", bundle::op_webgpu_render_bundle_encoder_draw, ); - super::reg_json_sync( + super::reg_sync( rt, "op_webgpu_render_bundle_encoder_draw_indexed", bundle::op_webgpu_render_bundle_encoder_draw_indexed, ); - super::reg_json_sync( + super::reg_sync( rt, "op_webgpu_render_bundle_encoder_draw_indirect", bundle::op_webgpu_render_bundle_encoder_draw_indirect, @@ -390,17 +378,17 @@ pub fn init(rt: &mut deno_core::JsRuntime) { } { // queue - super::reg_json_sync( + super::reg_sync( rt, "op_webgpu_queue_submit", queue::op_webgpu_queue_submit, ); - super::reg_json_sync( + super::reg_sync( rt, "op_webgpu_write_buffer", queue::op_webgpu_write_buffer, ); - super::reg_json_sync( + super::reg_sync( rt, "op_webgpu_write_texture", queue::op_webgpu_write_texture, @@ -408,7 +396,7 @@ pub fn init(rt: &mut deno_core::JsRuntime) { } { // shader - super::reg_json_sync( + super::reg_sync( rt, "op_webgpu_create_shader_module", shader::op_webgpu_create_shader_module, |