diff --git a/wgpu/src/backend/webgpu.rs b/wgpu/src/backend/webgpu.rs index 6cbebee8e0..ba96875066 100644 --- a/wgpu/src/backend/webgpu.rs +++ b/wgpu/src/backend/webgpu.rs @@ -385,15 +385,15 @@ fn map_primitive_state(primitive: &wgt::PrimitiveState) -> webgpu_sys::GpuPrimit use webgpu_sys::GpuPrimitiveTopology as pt; use wgt::PrimitiveTopology; - let mut mapped = webgpu_sys::GpuPrimitiveState::new(); - mapped.cull_mode(map_cull_mode(primitive.cull_mode)); - mapped.front_face(map_front_face(primitive.front_face)); + let mapped = webgpu_sys::GpuPrimitiveState::new(); + mapped.set_cull_mode(map_cull_mode(primitive.cull_mode)); + mapped.set_front_face(map_front_face(primitive.front_face)); if let Some(format) = primitive.strip_index_format { - mapped.strip_index_format(map_index_format(format)); + mapped.set_strip_index_format(map_index_format(format)); } - mapped.topology(match primitive.topology { + mapped.set_topology(match primitive.topology { PrimitiveTopology::PointList => pt::PointList, PrimitiveTopology::LineList => pt::LineList, PrimitiveTopology::LineStrip => pt::LineStrip, @@ -450,33 +450,33 @@ fn map_stencil_operation(op: wgt::StencilOperation) -> webgpu_sys::GpuStencilOpe } fn map_stencil_state_face(desc: &wgt::StencilFaceState) -> webgpu_sys::GpuStencilFaceState { - let mut mapped = webgpu_sys::GpuStencilFaceState::new(); - mapped.compare(map_compare_function(desc.compare)); - mapped.depth_fail_op(map_stencil_operation(desc.depth_fail_op)); - mapped.fail_op(map_stencil_operation(desc.fail_op)); - mapped.pass_op(map_stencil_operation(desc.pass_op)); + let mapped = webgpu_sys::GpuStencilFaceState::new(); + mapped.set_compare(map_compare_function(desc.compare)); + mapped.set_depth_fail_op(map_stencil_operation(desc.depth_fail_op)); + mapped.set_fail_op(map_stencil_operation(desc.fail_op)); + mapped.set_pass_op(map_stencil_operation(desc.pass_op)); mapped } fn map_depth_stencil_state(desc: &wgt::DepthStencilState) -> webgpu_sys::GpuDepthStencilState { - let mut mapped = webgpu_sys::GpuDepthStencilState::new(map_texture_format(desc.format)); - mapped.depth_compare(map_compare_function(desc.depth_compare)); - mapped.depth_write_enabled(desc.depth_write_enabled); - mapped.depth_bias(desc.bias.constant); - mapped.depth_bias_clamp(desc.bias.clamp); - mapped.depth_bias_slope_scale(desc.bias.slope_scale); - mapped.stencil_back(&map_stencil_state_face(&desc.stencil.back)); - mapped.stencil_front(&map_stencil_state_face(&desc.stencil.front)); - mapped.stencil_read_mask(desc.stencil.read_mask); - mapped.stencil_write_mask(desc.stencil.write_mask); + let mapped = webgpu_sys::GpuDepthStencilState::new(map_texture_format(desc.format)); + mapped.set_depth_compare(map_compare_function(desc.depth_compare)); + mapped.set_depth_write_enabled(desc.depth_write_enabled); + mapped.set_depth_bias(desc.bias.constant); + mapped.set_depth_bias_clamp(desc.bias.clamp); + mapped.set_depth_bias_slope_scale(desc.bias.slope_scale); + mapped.set_stencil_back(&map_stencil_state_face(&desc.stencil.back)); + mapped.set_stencil_front(&map_stencil_state_face(&desc.stencil.front)); + mapped.set_stencil_read_mask(desc.stencil.read_mask); + mapped.set_stencil_write_mask(desc.stencil.write_mask); mapped } fn map_blend_component(desc: &wgt::BlendComponent) -> webgpu_sys::GpuBlendComponent { - let mut mapped = webgpu_sys::GpuBlendComponent::new(); - mapped.dst_factor(map_blend_factor(desc.dst_factor)); - mapped.operation(map_blend_operation(desc.operation)); - mapped.src_factor(map_blend_factor(desc.src_factor)); + let mapped = webgpu_sys::GpuBlendComponent::new(); + mapped.set_dst_factor(map_blend_factor(desc.dst_factor)); + mapped.set_operation(map_blend_operation(desc.operation)); + mapped.set_src_factor(map_blend_factor(desc.src_factor)); mapped } @@ -584,24 +584,24 @@ fn map_vertex_step_mode(mode: wgt::VertexStepMode) -> webgpu_sys::GpuVertexStepM } fn map_extent_3d(extent: wgt::Extent3d) -> webgpu_sys::GpuExtent3dDict { - let mut mapped = webgpu_sys::GpuExtent3dDict::new(extent.width); - mapped.height(extent.height); - mapped.depth_or_array_layers(extent.depth_or_array_layers); + let mapped = webgpu_sys::GpuExtent3dDict::new(extent.width); + mapped.set_height(extent.height); + mapped.set_depth_or_array_layers(extent.depth_or_array_layers); mapped } fn map_origin_2d(extent: wgt::Origin2d) -> webgpu_sys::GpuOrigin2dDict { - let mut mapped = webgpu_sys::GpuOrigin2dDict::new(); - mapped.x(extent.x); - mapped.y(extent.y); + let mapped = webgpu_sys::GpuOrigin2dDict::new(); + mapped.set_x(extent.x); + mapped.set_y(extent.y); mapped } fn map_origin_3d(origin: wgt::Origin3d) -> webgpu_sys::GpuOrigin3dDict { - let mut mapped = webgpu_sys::GpuOrigin3dDict::new(); - mapped.x(origin.x); - mapped.y(origin.y); - mapped.z(origin.z); + let mapped = webgpu_sys::GpuOrigin3dDict::new(); + mapped.set_x(origin.x); + mapped.set_y(origin.y); + mapped.set_z(origin.z); mapped } @@ -629,49 +629,53 @@ fn map_texture_view_dimension( } } -fn map_buffer_copy_view(view: crate::TexelCopyBufferInfo<'_>) -> webgpu_sys::GpuImageCopyBuffer { +fn map_buffer_copy_view( + view: crate::TexelCopyBufferInfo<'_>, +) -> webgpu_sys::GpuTexelCopyBufferInfo { let buffer: &::BufferData = downcast_ref(view.buffer.data.as_ref()); - let mut mapped = webgpu_sys::GpuImageCopyBuffer::new(&buffer.0.buffer); + let mapped = webgpu_sys::GpuTexelCopyBufferInfo::new(&buffer.0.buffer); if let Some(bytes_per_row) = view.layout.bytes_per_row { - mapped.bytes_per_row(bytes_per_row); + mapped.set_bytes_per_row(bytes_per_row); } if let Some(rows_per_image) = view.layout.rows_per_image { - mapped.rows_per_image(rows_per_image); + mapped.set_rows_per_image(rows_per_image); } - mapped.offset(view.layout.offset as f64); + mapped.set_offset(view.layout.offset as f64); mapped } -fn map_texture_copy_view(view: crate::TexelCopyTextureInfo<'_>) -> webgpu_sys::GpuImageCopyTexture { +fn map_texture_copy_view( + view: crate::TexelCopyTextureInfo<'_>, +) -> webgpu_sys::GpuTexelCopyTextureInfo { let texture: &::TextureData = downcast_ref(view.texture.data.as_ref()); - let mut mapped = webgpu_sys::GpuImageCopyTexture::new(&texture.0); - mapped.mip_level(view.mip_level); - mapped.origin(&map_origin_3d(view.origin)); + let mapped = webgpu_sys::GpuTexelCopyTextureInfo::new(&texture.0); + mapped.set_mip_level(view.mip_level); + mapped.set_origin(&map_origin_3d(view.origin)); mapped } fn map_tagged_texture_copy_view( view: crate::CopyExternalImageDestInfo<'_>, -) -> webgpu_sys::GpuImageCopyTextureTagged { +) -> webgpu_sys::GpuCopyExternalImageDestInfo { let texture: &::TextureData = downcast_ref(view.texture.data.as_ref()); - let mut mapped = webgpu_sys::GpuImageCopyTextureTagged::new(&texture.0); - mapped.mip_level(view.mip_level); - mapped.origin(&map_origin_3d(view.origin)); - mapped.aspect(map_texture_aspect(view.aspect)); + let mapped = webgpu_sys::GpuCopyExternalImageDestInfo::new(&texture.0); + mapped.set_mip_level(view.mip_level); + mapped.set_origin(&map_origin_3d(view.origin)); + mapped.set_aspect(map_texture_aspect(view.aspect)); // mapped.color_space(map_color_space(view.color_space)); - mapped.premultiplied_alpha(view.premultiplied_alpha); + mapped.set_premultiplied_alpha(view.premultiplied_alpha); mapped } fn map_external_texture_copy_view( view: &crate::CopyExternalImageSourceInfo, -) -> webgpu_sys::GpuImageCopyExternalImage { - let mut mapped = webgpu_sys::GpuImageCopyExternalImage::new(&view.source); - mapped.origin(&map_origin_2d(view.origin)); - mapped.flip_y(view.flip_y); +) -> webgpu_sys::GpuCopyExternalImageSourceInfo { + let mapped = webgpu_sys::GpuCopyExternalImageSourceInfo::new(&view.source); + mapped.set_origin(&map_origin_2d(view.origin)); + mapped.set_flip_y(view.flip_y); mapped } @@ -1230,7 +1234,7 @@ impl crate::context::Context for ContextWebGpu { // It's not trivial, since we need the Future logic to have this check, // and currently the Future here has no room for extra parameter `backends`. //assert!(backends.contains(wgt::Backends::BROWSER_WEBGPU)); - let mut mapped_options = webgpu_sys::GpuRequestAdapterOptions::new(); + let mapped_options = webgpu_sys::GpuRequestAdapterOptions::new(); let mapped_power_preference = match options.power_preference { wgt::PowerPreference::None => None, wgt::PowerPreference::LowPower => Some(webgpu_sys::GpuPowerPreference::LowPower), @@ -1239,7 +1243,7 @@ impl crate::context::Context for ContextWebGpu { } }; if let Some(mapped_pref) = mapped_power_preference { - mapped_options.power_preference(mapped_pref); + mapped_options.set_power_preference(mapped_pref); } if let Some(gpu) = &self.gpu { let adapter_promise = gpu.request_adapter_with_options(&mapped_options); @@ -1263,7 +1267,7 @@ impl crate::context::Context for ContextWebGpu { //Error: Tracing isn't supported on the Web target } - let mut mapped_desc = webgpu_sys::GpuDeviceDescriptor::new(); + let mapped_desc = webgpu_sys::GpuDeviceDescriptor::new(); // TODO: Migrate to a web_sys api. // See https://github.com/rustwasm/wasm-bindgen/issues/3587 @@ -1287,10 +1291,10 @@ impl crate::context::Context for ContextWebGpu { } }) .collect::(); - mapped_desc.required_features(&required_features); + mapped_desc.set_required_features(&required_features); if let Some(label) = desc.label { - mapped_desc.label(label); + mapped_desc.set_label(label); } let device_promise = adapter_data.0.request_device_with_descriptor(&mapped_desc); @@ -1420,19 +1424,23 @@ impl crate::context::Context for ContextWebGpu { wgt::CompositeAlphaMode::PreMultiplied => webgpu_sys::GpuCanvasAlphaMode::Premultiplied, _ => webgpu_sys::GpuCanvasAlphaMode::Opaque, }; - let mut mapped = webgpu_sys::GpuCanvasConfiguration::new( + let mapped = webgpu_sys::GpuCanvasConfiguration::new( &device_data.0, map_texture_format(config.format), ); - mapped.usage(config.usage.bits()); - mapped.alpha_mode(alpha_mode); + mapped.set_usage(config.usage.bits()); + mapped.set_alpha_mode(alpha_mode); let mapped_view_formats = config .view_formats .iter() .map(|format| JsValue::from(map_texture_format(*format))) .collect::(); - mapped.view_formats(&mapped_view_formats); - surface_data.0 .1.configure(&mapped); + mapped.set_view_formats(&mapped_view_formats); + surface_data + .0 + .1 + .configure(&mapped) + .expect_throw("invalid surface configuration"); } fn surface_get_current_texture( @@ -1443,7 +1451,13 @@ impl crate::context::Context for ContextWebGpu { wgt::SurfaceStatus, Self::SurfaceOutputDetail, ) { - let surface_data = Sendable(surface_data.0 .1.get_current_texture()); + let surface_data = Sendable( + surface_data + .0 + .1 + .get_current_texture() + .expect_throw("invalid surface configuration"), + ); (Some(surface_data), wgt::SurfaceStatus::Good, ()) } @@ -1592,7 +1606,7 @@ impl crate::context::Context for ContextWebGpu { wgsl_text.as_str(), )) } - let (mut descriptor, compilation_info) = match shader_module_result { + let (descriptor, compilation_info) = match shader_module_result { Ok(v) => v, Err(compilation_info) => ( webgpu_sys::GpuShaderModuleDescriptor::new(""), @@ -1600,7 +1614,7 @@ impl crate::context::Context for ContextWebGpu { ), }; if let Some(label) = desc.label { - descriptor.label(label); + descriptor.set_label(label); } let shader_module = WebShaderModule { module: device_data.0.create_shader_module(&descriptor), @@ -1626,7 +1640,7 @@ impl crate::context::Context for ContextWebGpu { .entries .iter() .map(|bind| { - let mut mapped_entry = + let mapped_entry = webgpu_sys::GpuBindGroupLayoutEntry::new(bind.binding, bind.visibility.bits()); match bind.ty { @@ -1635,12 +1649,12 @@ impl crate::context::Context for ContextWebGpu { has_dynamic_offset, min_binding_size, } => { - let mut buffer = webgpu_sys::GpuBufferBindingLayout::new(); - buffer.has_dynamic_offset(has_dynamic_offset); + let buffer = webgpu_sys::GpuBufferBindingLayout::new(); + buffer.set_has_dynamic_offset(has_dynamic_offset); if let Some(size) = min_binding_size { - buffer.min_binding_size(size.get() as f64); + buffer.set_min_binding_size(size.get() as f64); } - buffer.type_(match ty { + buffer.set_type(match ty { wgt::BufferBindingType::Uniform => { webgpu_sys::GpuBufferBindingType::Uniform } @@ -1651,11 +1665,11 @@ impl crate::context::Context for ContextWebGpu { webgpu_sys::GpuBufferBindingType::ReadOnlyStorage } }); - mapped_entry.buffer(&buffer); + mapped_entry.set_buffer(&buffer); } wgt::BindingType::Sampler(ty) => { - let mut sampler = webgpu_sys::GpuSamplerBindingLayout::new(); - sampler.type_(match ty { + let sampler = webgpu_sys::GpuSamplerBindingLayout::new(); + sampler.set_type(match ty { wgt::SamplerBindingType::NonFiltering => { webgpu_sys::GpuSamplerBindingType::NonFiltering } @@ -1666,18 +1680,18 @@ impl crate::context::Context for ContextWebGpu { webgpu_sys::GpuSamplerBindingType::Comparison } }); - mapped_entry.sampler(&sampler); + mapped_entry.set_sampler(&sampler); } wgt::BindingType::Texture { multisampled, sample_type, view_dimension, } => { - let mut texture = webgpu_sys::GpuTextureBindingLayout::new(); - texture.multisampled(multisampled); - texture.sample_type(map_texture_component_type(sample_type)); - texture.view_dimension(map_texture_view_dimension(view_dimension)); - mapped_entry.texture(&texture); + let texture = webgpu_sys::GpuTextureBindingLayout::new(); + texture.set_multisampled(multisampled); + texture.set_sample_type(map_texture_component_type(sample_type)); + texture.set_view_dimension(map_texture_view_dimension(view_dimension)); + mapped_entry.set_texture(&texture); } wgt::BindingType::StorageTexture { access, @@ -1695,12 +1709,13 @@ impl crate::context::Context for ContextWebGpu { webgpu_sys::GpuStorageTextureAccess::ReadWrite } }; - let mut storage_texture = webgpu_sys::GpuStorageTextureBindingLayout::new( + let storage_texture = webgpu_sys::GpuStorageTextureBindingLayout::new( map_texture_format(format), ); - storage_texture.access(mapped_access); - storage_texture.view_dimension(map_texture_view_dimension(view_dimension)); - mapped_entry.storage_texture(&storage_texture); + storage_texture.set_access(mapped_access); + storage_texture + .set_view_dimension(map_texture_view_dimension(view_dimension)); + mapped_entry.set_storage_texture(&storage_texture); } wgt::BindingType::AccelerationStructure => todo!(), } @@ -1709,11 +1724,16 @@ impl crate::context::Context for ContextWebGpu { }) .collect::(); - let mut mapped_desc = webgpu_sys::GpuBindGroupLayoutDescriptor::new(&mapped_bindings); + let mapped_desc = webgpu_sys::GpuBindGroupLayoutDescriptor::new(&mapped_bindings); if let Some(label) = desc.label { - mapped_desc.label(label); + mapped_desc.set_label(label); } - Sendable(device_data.0.create_bind_group_layout(&mapped_desc)) + Sendable( + device_data + .0 + .create_bind_group_layout(&mapped_desc) + .expect_throw("could not create bind group layout"), + ) } fn device_create_bind_group( @@ -1733,11 +1753,11 @@ impl crate::context::Context for ContextWebGpu { }) => { let buffer: &::BufferData = downcast_ref(buffer.data.as_ref()); - let mut mapped_buffer_binding = + let mapped_buffer_binding = webgpu_sys::GpuBufferBinding::new(&buffer.0.buffer); - mapped_buffer_binding.offset(offset as f64); + mapped_buffer_binding.set_offset(offset as f64); if let Some(s) = size { - mapped_buffer_binding.size(s.get() as f64); + mapped_buffer_binding.set_size(s.get() as f64); } JsValue::from(mapped_buffer_binding) } @@ -1771,9 +1791,9 @@ impl crate::context::Context for ContextWebGpu { let bgl: &::BindGroupLayoutData = downcast_ref(desc.layout.data.as_ref()); - let mut mapped_desc = webgpu_sys::GpuBindGroupDescriptor::new(&mapped_entries, &bgl.0); + let mapped_desc = webgpu_sys::GpuBindGroupDescriptor::new(&mapped_entries, &bgl.0); if let Some(label) = desc.label { - mapped_desc.label(label); + mapped_desc.set_label(label); } Sendable(device_data.0.create_bind_group(&mapped_desc)) } @@ -1792,9 +1812,9 @@ impl crate::context::Context for ContextWebGpu { &bgl.0 }) .collect::(); - let mut mapped_desc = webgpu_sys::GpuPipelineLayoutDescriptor::new(&temp_layouts); + let mapped_desc = webgpu_sys::GpuPipelineLayoutDescriptor::new(&temp_layouts); if let Some(label) = desc.label { - mapped_desc.label(label); + mapped_desc.set_label(label); } Sendable(device_data.0.create_pipeline_layout(&mapped_desc)) } @@ -1806,13 +1826,13 @@ impl crate::context::Context for ContextWebGpu { ) -> Self::RenderPipelineData { let module: &::ShaderModuleData = downcast_ref(desc.vertex.module.data.as_ref()); - let mut mapped_vertex_state = webgpu_sys::GpuVertexState::new(&module.0.module); + let mapped_vertex_state = webgpu_sys::GpuVertexState::new(&module.0.module); insert_constants_map( &mapped_vertex_state, desc.vertex.compilation_options.constants, ); if let Some(ep) = desc.vertex.entry_point { - mapped_vertex_state.entry_point(ep); + mapped_vertex_state.set_entry_point(ep); } let buffers = desc @@ -1832,19 +1852,19 @@ impl crate::context::Context for ContextWebGpu { }) .collect::(); - let mut mapped_vbuf = webgpu_sys::GpuVertexBufferLayout::new( + let mapped_vbuf = webgpu_sys::GpuVertexBufferLayout::new( vbuf.array_stride as f64, &mapped_attributes, ); - mapped_vbuf.step_mode(map_vertex_step_mode(vbuf.step_mode)); + mapped_vbuf.set_step_mode(map_vertex_step_mode(vbuf.step_mode)); mapped_vbuf }) .collect::(); - mapped_vertex_state.buffers(&buffers); + mapped_vertex_state.set_buffers(&buffers); let auto_layout = wasm_bindgen::JsValue::from(webgpu_sys::GpuAutoLayoutMode::Auto); - let mut mapped_desc = webgpu_sys::GpuRenderPipelineDescriptor::new( + let mapped_desc = webgpu_sys::GpuRenderPipelineDescriptor::new( &match desc.layout { Some(layout) => { let layout: &::PipelineLayoutData = @@ -1857,11 +1877,11 @@ impl crate::context::Context for ContextWebGpu { ); if let Some(label) = desc.label { - mapped_desc.label(label); + mapped_desc.set_label(label); } if let Some(ref depth_stencil) = desc.depth_stencil { - mapped_desc.depth_stencil(&map_depth_stencil_state(depth_stencil)); + mapped_desc.set_depth_stencil(&map_depth_stencil_state(depth_stencil)); } if let Some(ref frag) = desc.fragment { @@ -1871,15 +1891,15 @@ impl crate::context::Context for ContextWebGpu { .map(|target| match target { Some(target) => { let mapped_format = map_texture_format(target.format); - let mut mapped_color_state = + let mapped_color_state = webgpu_sys::GpuColorTargetState::new(mapped_format); if let Some(ref bs) = target.blend { let alpha = map_blend_component(&bs.alpha); let color = map_blend_component(&bs.color); let mapped_blend_state = webgpu_sys::GpuBlendState::new(&alpha, &color); - mapped_color_state.blend(&mapped_blend_state); + mapped_color_state.set_blend(&mapped_blend_state); } - mapped_color_state.write_mask(target.write_mask.bits()); + mapped_color_state.set_write_mask(target.write_mask.bits()); wasm_bindgen::JsValue::from(mapped_color_state) } None => wasm_bindgen::JsValue::null(), @@ -1887,25 +1907,31 @@ impl crate::context::Context for ContextWebGpu { .collect::(); let module: &::ShaderModuleData = downcast_ref(frag.module.data.as_ref()); - let mut mapped_fragment_desc = + let mapped_fragment_desc = webgpu_sys::GpuFragmentState::new(&module.0.module, &targets); insert_constants_map(&mapped_vertex_state, frag.compilation_options.constants); if let Some(ep) = frag.entry_point { - mapped_fragment_desc.entry_point(ep); + mapped_fragment_desc.set_entry_point(ep); } - mapped_desc.fragment(&mapped_fragment_desc); + mapped_desc.set_fragment(&mapped_fragment_desc); } - let mut mapped_multisample = webgpu_sys::GpuMultisampleState::new(); - mapped_multisample.count(desc.multisample.count); - mapped_multisample.mask(desc.multisample.mask as u32); - mapped_multisample.alpha_to_coverage_enabled(desc.multisample.alpha_to_coverage_enabled); - mapped_desc.multisample(&mapped_multisample); + let mapped_multisample = webgpu_sys::GpuMultisampleState::new(); + mapped_multisample.set_count(desc.multisample.count); + mapped_multisample.set_mask(desc.multisample.mask as u32); + mapped_multisample + .set_alpha_to_coverage_enabled(desc.multisample.alpha_to_coverage_enabled); + mapped_desc.set_multisample(&mapped_multisample); let mapped_primitive = map_primitive_state(&desc.primitive); - mapped_desc.primitive(&mapped_primitive); + mapped_desc.set_primitive(&mapped_primitive); - Sendable(device_data.0.create_render_pipeline(&mapped_desc)) + Sendable( + device_data + .0 + .create_render_pipeline(&mapped_desc) + .expect_throw("could not create render pipeline"), + ) } fn device_create_compute_pipeline( @@ -1915,14 +1941,13 @@ impl crate::context::Context for ContextWebGpu { ) -> Self::ComputePipelineData { let shader_module: &::ShaderModuleData = downcast_ref(desc.module.data.as_ref()); - let mut mapped_compute_stage = - webgpu_sys::GpuProgrammableStage::new(&shader_module.0.module); + let mapped_compute_stage = webgpu_sys::GpuProgrammableStage::new(&shader_module.0.module); insert_constants_map(&mapped_compute_stage, desc.compilation_options.constants); if let Some(ep) = desc.entry_point { - mapped_compute_stage.entry_point(ep); + mapped_compute_stage.set_entry_point(ep); } let auto_layout = wasm_bindgen::JsValue::from(webgpu_sys::GpuAutoLayoutMode::Auto); - let mut mapped_desc = webgpu_sys::GpuComputePipelineDescriptor::new( + let mapped_desc = webgpu_sys::GpuComputePipelineDescriptor::new( &match desc.layout { Some(layout) => { let layout: &::PipelineLayoutData = @@ -1934,7 +1959,7 @@ impl crate::context::Context for ContextWebGpu { &mapped_compute_stage, ); if let Some(label) = desc.label { - mapped_desc.label(label); + mapped_desc.set_label(label); } Sendable(device_data.0.create_compute_pipeline(&mapped_desc)) @@ -1953,14 +1978,16 @@ impl crate::context::Context for ContextWebGpu { device_data: &Self::DeviceData, desc: &crate::BufferDescriptor<'_>, ) -> Self::BufferData { - let mut mapped_desc = - webgpu_sys::GpuBufferDescriptor::new(desc.size as f64, desc.usage.bits()); - mapped_desc.mapped_at_creation(desc.mapped_at_creation); + let mapped_desc = webgpu_sys::GpuBufferDescriptor::new(desc.size as f64, desc.usage.bits()); + mapped_desc.set_mapped_at_creation(desc.mapped_at_creation); if let Some(label) = desc.label { - mapped_desc.label(label); + mapped_desc.set_label(label); } Sendable(WebBuffer::new( - device_data.0.create_buffer(&mapped_desc), + device_data + .0 + .create_buffer(&mapped_desc) + .expect_throw("could not create buffer"), desc, )) } @@ -1970,24 +1997,29 @@ impl crate::context::Context for ContextWebGpu { device_data: &Self::DeviceData, desc: &crate::TextureDescriptor<'_>, ) -> Self::TextureData { - let mut mapped_desc = webgpu_sys::GpuTextureDescriptor::new( + let mapped_desc = webgpu_sys::GpuTextureDescriptor::new( map_texture_format(desc.format), &map_extent_3d(desc.size), desc.usage.bits(), ); if let Some(label) = desc.label { - mapped_desc.label(label); + mapped_desc.set_label(label); } - mapped_desc.dimension(map_texture_dimension(desc.dimension)); - mapped_desc.mip_level_count(desc.mip_level_count); - mapped_desc.sample_count(desc.sample_count); + mapped_desc.set_dimension(map_texture_dimension(desc.dimension)); + mapped_desc.set_mip_level_count(desc.mip_level_count); + mapped_desc.set_sample_count(desc.sample_count); let mapped_view_formats = desc .view_formats .iter() .map(|format| JsValue::from(map_texture_format(*format))) .collect::(); - mapped_desc.view_formats(&mapped_view_formats); - Sendable(device_data.0.create_texture(&mapped_desc)) + mapped_desc.set_view_formats(&mapped_view_formats); + Sendable( + device_data + .0 + .create_texture(&mapped_desc) + .expect_throw("could not create texture"), + ) } fn device_create_sampler( @@ -1995,22 +2027,22 @@ impl crate::context::Context for ContextWebGpu { device_data: &Self::DeviceData, desc: &crate::SamplerDescriptor<'_>, ) -> Self::SamplerData { - let mut mapped_desc = webgpu_sys::GpuSamplerDescriptor::new(); - mapped_desc.address_mode_u(map_address_mode(desc.address_mode_u)); - mapped_desc.address_mode_v(map_address_mode(desc.address_mode_v)); - mapped_desc.address_mode_w(map_address_mode(desc.address_mode_w)); + let mapped_desc = webgpu_sys::GpuSamplerDescriptor::new(); + mapped_desc.set_address_mode_u(map_address_mode(desc.address_mode_u)); + mapped_desc.set_address_mode_v(map_address_mode(desc.address_mode_v)); + mapped_desc.set_address_mode_w(map_address_mode(desc.address_mode_w)); if let Some(compare) = desc.compare { - mapped_desc.compare(map_compare_function(compare)); + mapped_desc.set_compare(map_compare_function(compare)); } - mapped_desc.lod_max_clamp(desc.lod_max_clamp); - mapped_desc.lod_min_clamp(desc.lod_min_clamp); - mapped_desc.mag_filter(map_filter_mode(desc.mag_filter)); - mapped_desc.min_filter(map_filter_mode(desc.min_filter)); - mapped_desc.mipmap_filter(map_mipmap_filter_mode(desc.mipmap_filter)); + mapped_desc.set_lod_max_clamp(desc.lod_max_clamp); + mapped_desc.set_lod_min_clamp(desc.lod_min_clamp); + mapped_desc.set_mag_filter(map_filter_mode(desc.mag_filter)); + mapped_desc.set_min_filter(map_filter_mode(desc.min_filter)); + mapped_desc.set_mipmap_filter(map_mipmap_filter_mode(desc.mipmap_filter)); // TODO: `max_anisotropy` is not available on `desc` yet // mapped_desc.max_anisotropy(desc.max_anisotropy); if let Some(label) = desc.label { - mapped_desc.label(label); + mapped_desc.set_label(label); } Sendable(device_data.0.create_sampler_with_descriptor(&mapped_desc)) } @@ -2025,11 +2057,16 @@ impl crate::context::Context for ContextWebGpu { wgt::QueryType::Timestamp => webgpu_sys::GpuQueryType::Timestamp, wgt::QueryType::PipelineStatistics(_) => unreachable!(), }; - let mut mapped_desc = webgpu_sys::GpuQuerySetDescriptor::new(desc.count, ty); + let mapped_desc = webgpu_sys::GpuQuerySetDescriptor::new(desc.count, ty); if let Some(label) = desc.label { - mapped_desc.label(label); + mapped_desc.set_label(label); } - Sendable(device_data.0.create_query_set(&mapped_desc)) + Sendable( + device_data + .0 + .create_query_set(&mapped_desc) + .expect_throw("could not create query set"), + ) } fn device_create_command_encoder( @@ -2037,9 +2074,9 @@ impl crate::context::Context for ContextWebGpu { device_data: &Self::DeviceData, desc: &crate::CommandEncoderDescriptor<'_>, ) -> Self::CommandEncoderData { - let mut mapped_desc = webgpu_sys::GpuCommandEncoderDescriptor::new(); + let mapped_desc = webgpu_sys::GpuCommandEncoderDescriptor::new(); if let Some(label) = desc.label { - mapped_desc.label(label); + mapped_desc.set_label(label); } Sendable( device_data @@ -2061,18 +2098,22 @@ impl crate::context::Context for ContextWebGpu { None => wasm_bindgen::JsValue::null(), }) .collect::(); - let mut mapped_desc = - webgpu_sys::GpuRenderBundleEncoderDescriptor::new(&mapped_color_formats); + let mapped_desc = webgpu_sys::GpuRenderBundleEncoderDescriptor::new(&mapped_color_formats); if let Some(label) = desc.label { - mapped_desc.label(label); + mapped_desc.set_label(label); } if let Some(ds) = desc.depth_stencil { - mapped_desc.depth_stencil_format(map_texture_format(ds.format)); - mapped_desc.depth_read_only(ds.depth_read_only); - mapped_desc.stencil_read_only(ds.stencil_read_only); + mapped_desc.set_depth_stencil_format(map_texture_format(ds.format)); + mapped_desc.set_depth_read_only(ds.depth_read_only); + mapped_desc.set_stencil_read_only(ds.stencil_read_only); } - mapped_desc.sample_count(desc.sample_count); - Sendable(device_data.0.create_render_bundle_encoder(&mapped_desc)) + mapped_desc.set_sample_count(desc.sample_count); + Sendable( + device_data + .0 + .create_render_bundle_encoder(&mapped_desc) + .expect_throw("could not create render bundle encoder"), + ) } fn device_drop(&self, _device_data: &Self::DeviceData) { @@ -2205,26 +2246,31 @@ impl crate::context::Context for ContextWebGpu { texture_data: &Self::TextureData, desc: &crate::TextureViewDescriptor<'_>, ) -> Self::TextureViewData { - let mut mapped = webgpu_sys::GpuTextureViewDescriptor::new(); + let mapped = webgpu_sys::GpuTextureViewDescriptor::new(); if let Some(dim) = desc.dimension { - mapped.dimension(map_texture_view_dimension(dim)); + mapped.set_dimension(map_texture_view_dimension(dim)); } if let Some(format) = desc.format { - mapped.format(map_texture_format(format)); + mapped.set_format(map_texture_format(format)); } - mapped.aspect(map_texture_aspect(desc.aspect)); - mapped.base_array_layer(desc.base_array_layer); + mapped.set_aspect(map_texture_aspect(desc.aspect)); + mapped.set_base_array_layer(desc.base_array_layer); if let Some(count) = desc.array_layer_count { - mapped.array_layer_count(count); + mapped.set_array_layer_count(count); } - mapped.base_mip_level(desc.base_mip_level); + mapped.set_base_mip_level(desc.base_mip_level); if let Some(count) = desc.mip_level_count { - mapped.mip_level_count(count); + mapped.set_mip_level_count(count); } if let Some(label) = desc.label { - mapped.label(label); + mapped.set_label(label); } - Sendable(texture_data.0.create_view_with_descriptor(&mapped)) + Sendable( + texture_data + .0 + .create_view_with_descriptor(&mapped) + .expect_throw("could not create view with descriptor"), + ) } fn surface_drop(&self, _surface_data: &Self::SurfaceData) { @@ -2333,6 +2379,7 @@ impl crate::context::Context for ContextWebGpu { destination_offset as f64, copy_size as f64, ) + .expect_throw("could not copy buffer to buffer") } fn command_encoder_copy_buffer_to_texture( @@ -2349,6 +2396,7 @@ impl crate::context::Context for ContextWebGpu { &map_texture_copy_view(destination), &map_extent_3d(copy_size), ) + .expect_throw("could not copy buffer to texture") } fn command_encoder_copy_texture_to_buffer( @@ -2365,6 +2413,7 @@ impl crate::context::Context for ContextWebGpu { &map_buffer_copy_view(destination), &map_extent_3d(copy_size), ) + .expect_throw("could not copy texture to buffer") } fn command_encoder_copy_texture_to_texture( @@ -2381,6 +2430,7 @@ impl crate::context::Context for ContextWebGpu { &map_texture_copy_view(destination), &map_extent_3d(copy_size), ) + .expect_throw("could not copy texture to texture") } fn command_encoder_begin_compute_pass( @@ -2388,22 +2438,22 @@ impl crate::context::Context for ContextWebGpu { encoder_data: &Self::CommandEncoderData, desc: &crate::ComputePassDescriptor<'_>, ) -> Self::ComputePassData { - let mut mapped_desc = webgpu_sys::GpuComputePassDescriptor::new(); + let mapped_desc = webgpu_sys::GpuComputePassDescriptor::new(); if let Some(label) = desc.label { - mapped_desc.label(label); + mapped_desc.set_label(label); } if let Some(ref timestamp_writes) = desc.timestamp_writes { let query_set: &::QuerySetData = downcast_ref(timestamp_writes.query_set.data.as_ref()); - let mut writes = webgpu_sys::GpuComputePassTimestampWrites::new(&query_set.0); + let writes = webgpu_sys::GpuComputePassTimestampWrites::new(&query_set.0); if let Some(index) = timestamp_writes.beginning_of_pass_write_index { - writes.beginning_of_pass_write_index(index); + writes.set_beginning_of_pass_write_index(index); } if let Some(index) = timestamp_writes.end_of_pass_write_index { - writes.end_of_pass_write_index(index); + writes.set_end_of_pass_write_index(index); } - mapped_desc.timestamp_writes(&writes); + mapped_desc.set_timestamp_writes(&writes); } Sendable( @@ -2435,20 +2485,20 @@ impl crate::context::Context for ContextWebGpu { let view: &::TextureViewData = downcast_ref(ca.view.data.as_ref()); - let mut mapped_color_attachment = webgpu_sys::GpuRenderPassColorAttachment::new( + let mapped_color_attachment = webgpu_sys::GpuRenderPassColorAttachment::new( load_value, map_store_op(ca.ops.store), &view.0, ); if let Some(cv) = clear_value { - mapped_color_attachment.clear_value(&cv); + mapped_color_attachment.set_clear_value(&cv); } if let Some(rt) = ca.resolve_target { let resolve_target_view: &::TextureViewData = downcast_ref(rt.data.as_ref()); - mapped_color_attachment.resolve_target(&resolve_target_view.0); + mapped_color_attachment.set_resolve_target(&resolve_target_view.0); } - mapped_color_attachment.store_op(map_store_op(ca.ops.store)); + mapped_color_attachment.set_store_op(map_store_op(ca.ops.store)); wasm_bindgen::JsValue::from(mapped_color_attachment) } @@ -2456,58 +2506,63 @@ impl crate::context::Context for ContextWebGpu { }) .collect::(); - let mut mapped_desc = webgpu_sys::GpuRenderPassDescriptor::new(&mapped_color_attachments); + let mapped_desc = webgpu_sys::GpuRenderPassDescriptor::new(&mapped_color_attachments); if let Some(label) = desc.label { - mapped_desc.label(label); + mapped_desc.set_label(label); } if let Some(dsa) = &desc.depth_stencil_attachment { let depth_stencil_attachment: &::TextureViewData = downcast_ref(dsa.view.data.as_ref()); - let mut mapped_depth_stencil_attachment = + let mapped_depth_stencil_attachment = webgpu_sys::GpuRenderPassDepthStencilAttachment::new(&depth_stencil_attachment.0); if let Some(ref ops) = dsa.depth_ops { let load_op = match ops.load { crate::LoadOp::Clear(v) => { - mapped_depth_stencil_attachment.depth_clear_value(v); + mapped_depth_stencil_attachment.set_depth_clear_value(v); webgpu_sys::GpuLoadOp::Clear } crate::LoadOp::Load => webgpu_sys::GpuLoadOp::Load, }; - mapped_depth_stencil_attachment.depth_load_op(load_op); - mapped_depth_stencil_attachment.depth_store_op(map_store_op(ops.store)); + mapped_depth_stencil_attachment.set_depth_load_op(load_op); + mapped_depth_stencil_attachment.set_depth_store_op(map_store_op(ops.store)); } - mapped_depth_stencil_attachment.depth_read_only(dsa.depth_ops.is_none()); + mapped_depth_stencil_attachment.set_depth_read_only(dsa.depth_ops.is_none()); if let Some(ref ops) = dsa.stencil_ops { let load_op = match ops.load { crate::LoadOp::Clear(v) => { - mapped_depth_stencil_attachment.stencil_clear_value(v); + mapped_depth_stencil_attachment.set_stencil_clear_value(v); webgpu_sys::GpuLoadOp::Clear } crate::LoadOp::Load => webgpu_sys::GpuLoadOp::Load, }; - mapped_depth_stencil_attachment.stencil_load_op(load_op); - mapped_depth_stencil_attachment.stencil_store_op(map_store_op(ops.store)); + mapped_depth_stencil_attachment.set_stencil_load_op(load_op); + mapped_depth_stencil_attachment.set_stencil_store_op(map_store_op(ops.store)); } - mapped_depth_stencil_attachment.stencil_read_only(dsa.stencil_ops.is_none()); - mapped_desc.depth_stencil_attachment(&mapped_depth_stencil_attachment); + mapped_depth_stencil_attachment.set_stencil_read_only(dsa.stencil_ops.is_none()); + mapped_desc.set_depth_stencil_attachment(&mapped_depth_stencil_attachment); } if let Some(ref timestamp_writes) = desc.timestamp_writes { let query_set: &::QuerySetData = downcast_ref(timestamp_writes.query_set.data.as_ref()); - let mut writes = webgpu_sys::GpuRenderPassTimestampWrites::new(&query_set.0); + let writes = webgpu_sys::GpuRenderPassTimestampWrites::new(&query_set.0); if let Some(index) = timestamp_writes.beginning_of_pass_write_index { - writes.beginning_of_pass_write_index(index); + writes.set_beginning_of_pass_write_index(index); } if let Some(index) = timestamp_writes.end_of_pass_write_index { - writes.end_of_pass_write_index(index); + writes.set_end_of_pass_write_index(index); } - mapped_desc.timestamp_writes(&writes); + mapped_desc.set_timestamp_writes(&writes); } - Sendable(encoder_data.0.begin_render_pass(&mapped_desc)) + Sendable( + encoder_data + .0 + .begin_render_pass(&mapped_desc) + .expect_throw("could not begin render pass"), + ) } fn command_encoder_finish( @@ -2518,8 +2573,8 @@ impl crate::context::Context for ContextWebGpu { Sendable(if label.is_empty() { encoder_data.0.finish() } else { - let mut mapped_desc = webgpu_sys::GpuCommandBufferDescriptor::new(); - mapped_desc.label(&label); + let mapped_desc = webgpu_sys::GpuCommandBufferDescriptor::new(); + mapped_desc.set_label(&label); encoder_data.0.finish_with_descriptor(&mapped_desc) }) } @@ -2611,8 +2666,8 @@ impl crate::context::Context for ContextWebGpu { ) -> Self::RenderBundleData { Sendable(match desc.label { Some(label) => { - let mut mapped_desc = webgpu_sys::GpuRenderBundleDescriptor::new(); - mapped_desc.label(label); + let mapped_desc = webgpu_sys::GpuRenderBundleDescriptor::new(); + mapped_desc.set_label(label); encoder_data.0.finish_with_descriptor(&mapped_desc) } None => encoder_data.0.finish(), @@ -2643,7 +2698,8 @@ impl crate::context::Context for ContextWebGpu { &js_sys::Uint8Array::from(data).buffer(), 0f64, data.len() as f64, - ); + ) + .expect_throw("invalid buffer write"); } fn queue_validate_write_buffer( @@ -2714,14 +2770,14 @@ impl crate::context::Context for ContextWebGpu { data_layout: wgt::TexelCopyBufferLayout, size: wgt::Extent3d, ) { - let mut mapped_data_layout = webgpu_sys::GpuImageDataLayout::new(); + let mapped_data_layout = webgpu_sys::GpuTexelCopyBufferLayout::new(); if let Some(bytes_per_row) = data_layout.bytes_per_row { - mapped_data_layout.bytes_per_row(bytes_per_row); + mapped_data_layout.set_bytes_per_row(bytes_per_row); } if let Some(rows_per_image) = data_layout.rows_per_image { - mapped_data_layout.rows_per_image(rows_per_image); + mapped_data_layout.set_rows_per_image(rows_per_image); } - mapped_data_layout.offset(data_layout.offset as f64); + mapped_data_layout.set_offset(data_layout.offset as f64); /* Skip the copy once gecko allows BufferSource instead of ArrayBuffer queue_data.0.write_texture_with_u8_array_and_gpu_extent_3d_dict( @@ -2738,7 +2794,8 @@ impl crate::context::Context for ContextWebGpu { &js_sys::Uint8Array::from(data).buffer(), &mapped_data_layout, &map_extent_3d(size), - ); + ) + .expect_throw("invalid texture write"); } fn queue_copy_external_image_to_texture( @@ -2754,7 +2811,8 @@ impl crate::context::Context for ContextWebGpu { &map_external_texture_copy_view(source), &map_tagged_texture_copy_view(dest), &map_extent_3d(size), - ); + ) + .expect_throw("invalid copy from external image to texture"); } fn queue_submit>( @@ -2831,10 +2889,11 @@ impl crate::context::Context for ContextWebGpu { .set_bind_group_with_u32_array_and_f64_and_dynamic_offsets_data_length( index, Some(&bind_group_data.0), - offsets, + unsafe { &js_sys::Uint32Array::view(offsets) }, 0f64, offsets.len() as u32, - ); + ) + .expect_throw("invalid usage when setting bind group"); } } @@ -2950,10 +3009,11 @@ impl crate::context::Context for ContextWebGpu { .set_bind_group_with_u32_array_and_f64_and_dynamic_offsets_data_length( index, Some(&bind_group_data.0), - offsets, + unsafe { &js_sys::Uint32Array::view(offsets) }, 0f64, offsets.len() as u32, - ); + ) + .expect_throw("invalid usage when setting bind group"); } } @@ -3105,10 +3165,11 @@ impl crate::context::Context for ContextWebGpu { .set_bind_group_with_u32_array_and_f64_and_dynamic_offsets_data_length( index, Some(&bind_group_data.0), - offsets, + unsafe { &js_sys::Uint32Array::view(offsets) }, 0f64, offsets.len() as u32, - ); + ) + .expect_throw("invalid usage when setting bind group"); } } @@ -3285,7 +3346,8 @@ impl crate::context::Context for ContextWebGpu { ) { pass_data .0 - .set_blend_constant_with_gpu_color_dict(&map_color(color)); + .set_blend_constant_with_gpu_color_dict(&map_color(color)) + .expect_throw("could not set blend constant"); } fn render_pass_set_scissor_rect( @@ -3488,10 +3550,12 @@ impl WebBuffer { /// Creates a raw Javascript array buffer over the provided range. fn get_mapped_array_buffer(&self, sub_range: Range) -> js_sys::ArrayBuffer { - self.buffer.get_mapped_range_with_f64_and_f64( - sub_range.start as f64, - (sub_range.end - sub_range.start) as f64, - ) + self.buffer + .get_mapped_range_with_f64_and_f64( + sub_range.start as f64, + (sub_range.end - sub_range.start) as f64, + ) + .expect_throw("invalid mapped range") } /// Obtains a reference to the re-usable buffer mapping as a Javascript array view. @@ -3499,10 +3563,12 @@ impl WebBuffer { let mut mapping = self.mapping.borrow_mut(); let range = mapping.range.clone(); let array_buffer = mapping.mapped_buffer.get_or_insert_with(|| { - self.buffer.get_mapped_range_with_f64_and_f64( - range.start as f64, - (range.end - range.start) as f64, - ) + self.buffer + .get_mapped_range_with_f64_and_f64( + range.start as f64, + (range.end - range.start) as f64, + ) + .expect_throw("invalid mapped range") }); js_sys::Uint8Array::new_with_byte_offset_and_length( array_buffer, diff --git a/wgpu/src/backend/webgpu/webgpu_sys/gen_Gpu.rs b/wgpu/src/backend/webgpu/webgpu_sys/gen_Gpu.rs index 9e996d7b0a..63248496fc 100644 --- a/wgpu/src/backend/webgpu/webgpu_sys/gen_Gpu.rs +++ b/wgpu/src/backend/webgpu/webgpu_sys/gen_Gpu.rs @@ -18,7 +18,7 @@ // // If you want to improve the generated code, please submit a PR to the https://github.com/rustwasm/wasm-bindgen repository. // -// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.91` command. +// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.97` command. #![allow(unused_imports)] #![allow(clippy::all)] use super::*; diff --git a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuAdapter.rs b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuAdapter.rs index d97b308a33..56f55c9177 100644 --- a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuAdapter.rs +++ b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuAdapter.rs @@ -18,7 +18,7 @@ // // If you want to improve the generated code, please submit a PR to the https://github.com/rustwasm/wasm-bindgen repository. // -// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.91` command. +// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.97` command. #![allow(unused_imports)] #![allow(clippy::all)] use super::*; @@ -60,27 +60,27 @@ extern "C" { #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn limits(this: &GpuAdapter) -> GpuSupportedLimits; - # [wasm_bindgen (structural , method , getter , js_class = "GPUAdapter" , js_name = isFallbackAdapter)] - #[doc = "Getter for the `isFallbackAdapter` field of this object."] + # [wasm_bindgen (structural , method , getter , js_class = "GPUAdapter" , js_name = info)] + #[doc = "Getter for the `info` field of this object."] #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUAdapter/isFallbackAdapter)"] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUAdapter/info)"] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuAdapter`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuAdapter`, `GpuAdapterInfo`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn is_fallback_adapter(this: &GpuAdapter) -> bool; + pub fn info(this: &GpuAdapter) -> GpuAdapterInfo; - # [wasm_bindgen (method , structural , js_class = "GPUAdapter" , js_name = requestAdapterInfo)] - #[doc = "The `requestAdapterInfo()` method."] + # [wasm_bindgen (structural , method , getter , js_class = "GPUAdapter" , js_name = isFallbackAdapter)] + #[doc = "Getter for the `isFallbackAdapter` field of this object."] #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUAdapter/requestAdapterInfo)"] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUAdapter/isFallbackAdapter)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `GpuAdapter`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn request_adapter_info(this: &GpuAdapter) -> ::js_sys::Promise; + pub fn is_fallback_adapter(this: &GpuAdapter) -> bool; # [wasm_bindgen (method , structural , js_class = "GPUAdapter" , js_name = requestDevice)] #[doc = "The `requestDevice()` method."] diff --git a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuImageCopyExternalImage.rs b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuAdapterInfo.rs similarity index 59% rename from wgpu/src/backend/webgpu/webgpu_sys/gen_GpuImageCopyExternalImage.rs rename to wgpu/src/backend/webgpu/webgpu_sys/gen_GpuAdapterInfo.rs index bc301db717..04a6e36e47 100644 --- a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuImageCopyExternalImage.rs +++ b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuAdapterInfo.rs @@ -18,7 +18,7 @@ // // If you want to improve the generated code, please submit a PR to the https://github.com/rustwasm/wasm-bindgen repository. // -// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.91` command. +// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.97` command. #![allow(unused_imports)] #![allow(clippy::all)] use super::*; @@ -26,81 +26,59 @@ use wasm_bindgen::prelude::*; #[wasm_bindgen] extern "C" { - # [wasm_bindgen (extends = :: js_sys :: Object , js_name = GPUImageCopyExternalImage)] + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = GPUAdapterInfo , typescript_type = "GPUAdapterInfo")] #[derive(Debug, Clone, PartialEq, Eq)] - #[doc = "The `GpuImageCopyExternalImage` dictionary."] + #[doc = "The `GpuAdapterInfo` class."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuImageCopyExternalImage`*"] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUAdapterInfo)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuAdapterInfo`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub type GpuImageCopyExternalImage; -} + pub type GpuAdapterInfo; -impl GpuImageCopyExternalImage { - #[doc = "Construct a new `GpuImageCopyExternalImage`."] + # [wasm_bindgen (structural , method , getter , js_class = "GPUAdapterInfo" , js_name = vendor)] + #[doc = "Getter for the `vendor` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUAdapterInfo/vendor)"] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuImageCopyExternalImage`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuAdapterInfo`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn new(source: &::js_sys::Object) -> Self { - #[allow(unused_mut)] - let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); - ret.source(source); - ret - } + pub fn vendor(this: &GpuAdapterInfo) -> ::alloc::string::String; - #[doc = "Change the `flipY` field of this object."] + # [wasm_bindgen (structural , method , getter , js_class = "GPUAdapterInfo" , js_name = architecture)] + #[doc = "Getter for the `architecture` field of this object."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuImageCopyExternalImage`*"] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUAdapterInfo/architecture)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuAdapterInfo`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn flip_y(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("flipY"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + pub fn architecture(this: &GpuAdapterInfo) -> ::alloc::string::String; - #[doc = "Change the `origin` field of this object."] + # [wasm_bindgen (structural , method , getter , js_class = "GPUAdapterInfo" , js_name = device)] + #[doc = "Getter for the `device` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUAdapterInfo/device)"] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuImageCopyExternalImage`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuAdapterInfo`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn origin(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("origin"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + pub fn device(this: &GpuAdapterInfo) -> ::alloc::string::String; - #[doc = "Change the `source` field of this object."] + # [wasm_bindgen (structural , method , getter , js_class = "GPUAdapterInfo" , js_name = description)] + #[doc = "Getter for the `description` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUAdapterInfo/description)"] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuImageCopyExternalImage`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuAdapterInfo`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn source(&mut self, val: &::js_sys::Object) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("source"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + pub fn description(this: &GpuAdapterInfo) -> ::alloc::string::String; } diff --git a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuAddressMode.rs b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuAddressMode.rs index c2143c693b..c86d2dc8e9 100644 --- a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuAddressMode.rs +++ b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuAddressMode.rs @@ -18,7 +18,7 @@ // // If you want to improve the generated code, please submit a PR to the https://github.com/rustwasm/wasm-bindgen repository. // -// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.91` command. +// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.97` command. #![allow(unused_imports)] #![allow(clippy::all)] use wasm_bindgen::prelude::*; diff --git a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuAutoLayoutMode.rs b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuAutoLayoutMode.rs index b17f983fc4..0a5cd490ce 100644 --- a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuAutoLayoutMode.rs +++ b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuAutoLayoutMode.rs @@ -18,7 +18,7 @@ // // If you want to improve the generated code, please submit a PR to the https://github.com/rustwasm/wasm-bindgen repository. // -// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.91` command. +// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.97` command. #![allow(unused_imports)] #![allow(clippy::all)] use wasm_bindgen::prelude::*; diff --git a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuBindGroup.rs b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuBindGroup.rs index 70670a1e9a..50e9c38d58 100644 --- a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuBindGroup.rs +++ b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuBindGroup.rs @@ -18,7 +18,7 @@ // // If you want to improve the generated code, please submit a PR to the https://github.com/rustwasm/wasm-bindgen repository. // -// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.91` command. +// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.97` command. #![allow(unused_imports)] #![allow(clippy::all)] use super::*; @@ -47,7 +47,7 @@ extern "C" { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn label(this: &GpuBindGroup) -> String; + pub fn label(this: &GpuBindGroup) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "GPUBindGroup" , js_name = label)] #[doc = "Setter for the `label` field of this object."] diff --git a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuBindGroupDescriptor.rs b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuBindGroupDescriptor.rs index 76a1296c5f..dd861c6b06 100644 --- a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuBindGroupDescriptor.rs +++ b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuBindGroupDescriptor.rs @@ -18,7 +18,7 @@ // // If you want to improve the generated code, please submit a PR to the https://github.com/rustwasm/wasm-bindgen repository. // -// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.91` command. +// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.97` command. #![allow(unused_imports)] #![allow(clippy::all)] use super::*; @@ -35,22 +35,15 @@ extern "C" { #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub type GpuBindGroupDescriptor; -} -impl GpuBindGroupDescriptor { - #[doc = "Construct a new `GpuBindGroupDescriptor`."] + #[doc = "Get the `label` field of this object."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuBindGroupDescriptor`, `GpuBindGroupLayout`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuBindGroupDescriptor`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn new(entries: &::wasm_bindgen::JsValue, layout: &GpuBindGroupLayout) -> Self { - #[allow(unused_mut)] - let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); - ret.entries(entries); - ret.layout(layout); - ret - } + #[wasm_bindgen(method, getter = "label")] + pub fn get_label(this: &GpuBindGroupDescriptor) -> Option<::alloc::string::String>; #[doc = "Change the `label` field of this object."] #[doc = ""] @@ -58,16 +51,17 @@ impl GpuBindGroupDescriptor { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn label(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("label"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "label")] + pub fn set_label(this: &GpuBindGroupDescriptor, val: &str); + + #[doc = "Get the `entries` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBindGroupDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "entries")] + pub fn get_entries(this: &GpuBindGroupDescriptor) -> ::js_sys::Array; #[doc = "Change the `entries` field of this object."] #[doc = ""] @@ -75,20 +69,17 @@ impl GpuBindGroupDescriptor { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn entries(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("entries"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "entries")] + pub fn set_entries(this: &GpuBindGroupDescriptor, val: &::wasm_bindgen::JsValue); + + #[doc = "Get the `layout` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBindGroupDescriptor`, `GpuBindGroupLayout`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "layout")] + pub fn get_layout(this: &GpuBindGroupDescriptor) -> GpuBindGroupLayout; #[doc = "Change the `layout` field of this object."] #[doc = ""] @@ -96,15 +87,40 @@ impl GpuBindGroupDescriptor { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "layout")] + pub fn set_layout(this: &GpuBindGroupDescriptor, val: &GpuBindGroupLayout); +} + +impl GpuBindGroupDescriptor { + #[doc = "Construct a new `GpuBindGroupDescriptor`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBindGroupDescriptor`, `GpuBindGroupLayout`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new(entries: &::wasm_bindgen::JsValue, layout: &GpuBindGroupLayout) -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret.set_entries(entries); + ret.set_layout(layout); + ret + } + + #[deprecated = "Use `set_label()` instead."] + pub fn label(&mut self, val: &str) -> &mut Self { + self.set_label(val); + self + } + + #[deprecated = "Use `set_entries()` instead."] + pub fn entries(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { + self.set_entries(val); + self + } + + #[deprecated = "Use `set_layout()` instead."] pub fn layout(&mut self, val: &GpuBindGroupLayout) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("layout"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_layout(val); self } } diff --git a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuBindGroupEntry.rs b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuBindGroupEntry.rs index b29899d077..bb55ea5b8a 100644 --- a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuBindGroupEntry.rs +++ b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuBindGroupEntry.rs @@ -18,7 +18,7 @@ // // If you want to improve the generated code, please submit a PR to the https://github.com/rustwasm/wasm-bindgen repository. // -// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.91` command. +// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.97` command. #![allow(unused_imports)] #![allow(clippy::all)] use super::*; @@ -35,22 +35,15 @@ extern "C" { #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub type GpuBindGroupEntry; -} -impl GpuBindGroupEntry { - #[doc = "Construct a new `GpuBindGroupEntry`."] + #[doc = "Get the `binding` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `GpuBindGroupEntry`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn new(binding: u32, resource: &::wasm_bindgen::JsValue) -> Self { - #[allow(unused_mut)] - let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); - ret.binding(binding); - ret.resource(resource); - ret - } + #[wasm_bindgen(method, getter = "binding")] + pub fn get_binding(this: &GpuBindGroupEntry) -> u32; #[doc = "Change the `binding` field of this object."] #[doc = ""] @@ -58,20 +51,17 @@ impl GpuBindGroupEntry { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn binding(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("binding"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "binding")] + pub fn set_binding(this: &GpuBindGroupEntry, val: u32); + + #[doc = "Get the `resource` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBindGroupEntry`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "resource")] + pub fn get_resource(this: &GpuBindGroupEntry) -> ::wasm_bindgen::JsValue; #[doc = "Change the `resource` field of this object."] #[doc = ""] @@ -79,18 +69,34 @@ impl GpuBindGroupEntry { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "resource")] + pub fn set_resource(this: &GpuBindGroupEntry, val: &::wasm_bindgen::JsValue); +} + +impl GpuBindGroupEntry { + #[doc = "Construct a new `GpuBindGroupEntry`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBindGroupEntry`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new(binding: u32, resource: &::wasm_bindgen::JsValue) -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret.set_binding(binding); + ret.set_resource(resource); + ret + } + + #[deprecated = "Use `set_binding()` instead."] + pub fn binding(&mut self, val: u32) -> &mut Self { + self.set_binding(val); + self + } + + #[deprecated = "Use `set_resource()` instead."] pub fn resource(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("resource"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_resource(val); self } } diff --git a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuBindGroupLayout.rs b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuBindGroupLayout.rs index 7e0a96f09d..f11a133936 100644 --- a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuBindGroupLayout.rs +++ b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuBindGroupLayout.rs @@ -18,7 +18,7 @@ // // If you want to improve the generated code, please submit a PR to the https://github.com/rustwasm/wasm-bindgen repository. // -// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.91` command. +// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.97` command. #![allow(unused_imports)] #![allow(clippy::all)] use super::*; @@ -47,7 +47,7 @@ extern "C" { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn label(this: &GpuBindGroupLayout) -> String; + pub fn label(this: &GpuBindGroupLayout) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "GPUBindGroupLayout" , js_name = label)] #[doc = "Setter for the `label` field of this object."] diff --git a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuBindGroupLayoutDescriptor.rs b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuBindGroupLayoutDescriptor.rs index bf09137381..7e4a50a2db 100644 --- a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuBindGroupLayoutDescriptor.rs +++ b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuBindGroupLayoutDescriptor.rs @@ -18,7 +18,7 @@ // // If you want to improve the generated code, please submit a PR to the https://github.com/rustwasm/wasm-bindgen repository. // -// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.91` command. +// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.97` command. #![allow(unused_imports)] #![allow(clippy::all)] use super::*; @@ -35,21 +35,15 @@ extern "C" { #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub type GpuBindGroupLayoutDescriptor; -} -impl GpuBindGroupLayoutDescriptor { - #[doc = "Construct a new `GpuBindGroupLayoutDescriptor`."] + #[doc = "Get the `label` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `GpuBindGroupLayoutDescriptor`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn new(entries: &::wasm_bindgen::JsValue) -> Self { - #[allow(unused_mut)] - let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); - ret.entries(entries); - ret - } + #[wasm_bindgen(method, getter = "label")] + pub fn get_label(this: &GpuBindGroupLayoutDescriptor) -> Option<::alloc::string::String>; #[doc = "Change the `label` field of this object."] #[doc = ""] @@ -57,16 +51,17 @@ impl GpuBindGroupLayoutDescriptor { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn label(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("label"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "label")] + pub fn set_label(this: &GpuBindGroupLayoutDescriptor, val: &str); + + #[doc = "Get the `entries` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBindGroupLayoutDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "entries")] + pub fn get_entries(this: &GpuBindGroupLayoutDescriptor) -> ::js_sys::Array; #[doc = "Change the `entries` field of this object."] #[doc = ""] @@ -74,18 +69,33 @@ impl GpuBindGroupLayoutDescriptor { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "entries")] + pub fn set_entries(this: &GpuBindGroupLayoutDescriptor, val: &::wasm_bindgen::JsValue); +} + +impl GpuBindGroupLayoutDescriptor { + #[doc = "Construct a new `GpuBindGroupLayoutDescriptor`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBindGroupLayoutDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new(entries: &::wasm_bindgen::JsValue) -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret.set_entries(entries); + ret + } + + #[deprecated = "Use `set_label()` instead."] + pub fn label(&mut self, val: &str) -> &mut Self { + self.set_label(val); + self + } + + #[deprecated = "Use `set_entries()` instead."] pub fn entries(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("entries"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_entries(val); self } } diff --git a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuBindGroupLayoutEntry.rs b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuBindGroupLayoutEntry.rs index 40fe762a6d..e13a7b575d 100644 --- a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuBindGroupLayoutEntry.rs +++ b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuBindGroupLayoutEntry.rs @@ -18,7 +18,7 @@ // // If you want to improve the generated code, please submit a PR to the https://github.com/rustwasm/wasm-bindgen repository. // -// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.91` command. +// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.97` command. #![allow(unused_imports)] #![allow(clippy::all)] use super::*; @@ -35,22 +35,15 @@ extern "C" { #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub type GpuBindGroupLayoutEntry; -} -impl GpuBindGroupLayoutEntry { - #[doc = "Construct a new `GpuBindGroupLayoutEntry`."] + #[doc = "Get the `binding` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `GpuBindGroupLayoutEntry`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn new(binding: u32, visibility: u32) -> Self { - #[allow(unused_mut)] - let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); - ret.binding(binding); - ret.visibility(visibility); - ret - } + #[wasm_bindgen(method, getter = "binding")] + pub fn get_binding(this: &GpuBindGroupLayoutEntry) -> u32; #[doc = "Change the `binding` field of this object."] #[doc = ""] @@ -58,20 +51,17 @@ impl GpuBindGroupLayoutEntry { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn binding(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("binding"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "binding")] + pub fn set_binding(this: &GpuBindGroupLayoutEntry, val: u32); + + #[doc = "Get the `buffer` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBindGroupLayoutEntry`, `GpuBufferBindingLayout`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "buffer")] + pub fn get_buffer(this: &GpuBindGroupLayoutEntry) -> Option; #[doc = "Change the `buffer` field of this object."] #[doc = ""] @@ -79,17 +69,19 @@ impl GpuBindGroupLayoutEntry { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn buffer(&mut self, val: &GpuBufferBindingLayout) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("buffer"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "buffer")] + pub fn set_buffer(this: &GpuBindGroupLayoutEntry, val: &GpuBufferBindingLayout); + + #[doc = "Get the `externalTexture` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBindGroupLayoutEntry`, `GpuExternalTextureBindingLayout`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "externalTexture")] + pub fn get_external_texture( + this: &GpuBindGroupLayoutEntry, + ) -> Option; #[doc = "Change the `externalTexture` field of this object."] #[doc = ""] @@ -97,20 +89,20 @@ impl GpuBindGroupLayoutEntry { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn external_texture(&mut self, val: &GpuExternalTextureBindingLayout) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("externalTexture"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "externalTexture")] + pub fn set_external_texture( + this: &GpuBindGroupLayoutEntry, + val: &GpuExternalTextureBindingLayout, + ); + + #[doc = "Get the `sampler` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBindGroupLayoutEntry`, `GpuSamplerBindingLayout`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "sampler")] + pub fn get_sampler(this: &GpuBindGroupLayoutEntry) -> Option; #[doc = "Change the `sampler` field of this object."] #[doc = ""] @@ -118,20 +110,19 @@ impl GpuBindGroupLayoutEntry { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn sampler(&mut self, val: &GpuSamplerBindingLayout) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("sampler"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "sampler")] + pub fn set_sampler(this: &GpuBindGroupLayoutEntry, val: &GpuSamplerBindingLayout); + + #[doc = "Get the `storageTexture` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBindGroupLayoutEntry`, `GpuStorageTextureBindingLayout`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "storageTexture")] + pub fn get_storage_texture( + this: &GpuBindGroupLayoutEntry, + ) -> Option; #[doc = "Change the `storageTexture` field of this object."] #[doc = ""] @@ -139,20 +130,20 @@ impl GpuBindGroupLayoutEntry { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn storage_texture(&mut self, val: &GpuStorageTextureBindingLayout) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("storageTexture"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "storageTexture")] + pub fn set_storage_texture( + this: &GpuBindGroupLayoutEntry, + val: &GpuStorageTextureBindingLayout, + ); + + #[doc = "Get the `texture` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBindGroupLayoutEntry`, `GpuTextureBindingLayout`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "texture")] + pub fn get_texture(this: &GpuBindGroupLayoutEntry) -> Option; #[doc = "Change the `texture` field of this object."] #[doc = ""] @@ -160,20 +151,17 @@ impl GpuBindGroupLayoutEntry { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn texture(&mut self, val: &GpuTextureBindingLayout) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("texture"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "texture")] + pub fn set_texture(this: &GpuBindGroupLayoutEntry, val: &GpuTextureBindingLayout); + + #[doc = "Get the `visibility` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBindGroupLayoutEntry`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "visibility")] + pub fn get_visibility(this: &GpuBindGroupLayoutEntry) -> u32; #[doc = "Change the `visibility` field of this object."] #[doc = ""] @@ -181,18 +169,64 @@ impl GpuBindGroupLayoutEntry { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "visibility")] + pub fn set_visibility(this: &GpuBindGroupLayoutEntry, val: u32); +} + +impl GpuBindGroupLayoutEntry { + #[doc = "Construct a new `GpuBindGroupLayoutEntry`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBindGroupLayoutEntry`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new(binding: u32, visibility: u32) -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret.set_binding(binding); + ret.set_visibility(visibility); + ret + } + + #[deprecated = "Use `set_binding()` instead."] + pub fn binding(&mut self, val: u32) -> &mut Self { + self.set_binding(val); + self + } + + #[deprecated = "Use `set_buffer()` instead."] + pub fn buffer(&mut self, val: &GpuBufferBindingLayout) -> &mut Self { + self.set_buffer(val); + self + } + + #[deprecated = "Use `set_external_texture()` instead."] + pub fn external_texture(&mut self, val: &GpuExternalTextureBindingLayout) -> &mut Self { + self.set_external_texture(val); + self + } + + #[deprecated = "Use `set_sampler()` instead."] + pub fn sampler(&mut self, val: &GpuSamplerBindingLayout) -> &mut Self { + self.set_sampler(val); + self + } + + #[deprecated = "Use `set_storage_texture()` instead."] + pub fn storage_texture(&mut self, val: &GpuStorageTextureBindingLayout) -> &mut Self { + self.set_storage_texture(val); + self + } + + #[deprecated = "Use `set_texture()` instead."] + pub fn texture(&mut self, val: &GpuTextureBindingLayout) -> &mut Self { + self.set_texture(val); + self + } + + #[deprecated = "Use `set_visibility()` instead."] pub fn visibility(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("visibility"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_visibility(val); self } } diff --git a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuBlendComponent.rs b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuBlendComponent.rs index 3a19570db1..99d708b726 100644 --- a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuBlendComponent.rs +++ b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuBlendComponent.rs @@ -18,7 +18,7 @@ // // If you want to improve the generated code, please submit a PR to the https://github.com/rustwasm/wasm-bindgen repository. // -// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.91` command. +// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.97` command. #![allow(unused_imports)] #![allow(clippy::all)] use super::*; @@ -35,20 +35,15 @@ extern "C" { #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub type GpuBlendComponent; -} -impl GpuBlendComponent { - #[doc = "Construct a new `GpuBlendComponent`."] + #[doc = "Get the `dstFactor` field of this object."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuBlendComponent`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuBlendComponent`, `GpuBlendFactor`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn new() -> Self { - #[allow(unused_mut)] - let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); - ret - } + #[wasm_bindgen(method, getter = "dstFactor")] + pub fn get_dst_factor(this: &GpuBlendComponent) -> Option; #[doc = "Change the `dstFactor` field of this object."] #[doc = ""] @@ -56,20 +51,17 @@ impl GpuBlendComponent { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn dst_factor(&mut self, val: GpuBlendFactor) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("dstFactor"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "dstFactor")] + pub fn set_dst_factor(this: &GpuBlendComponent, val: GpuBlendFactor); + + #[doc = "Get the `operation` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBlendComponent`, `GpuBlendOperation`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "operation")] + pub fn get_operation(this: &GpuBlendComponent) -> Option; #[doc = "Change the `operation` field of this object."] #[doc = ""] @@ -77,20 +69,17 @@ impl GpuBlendComponent { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn operation(&mut self, val: GpuBlendOperation) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("operation"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "operation")] + pub fn set_operation(this: &GpuBlendComponent, val: GpuBlendOperation); + + #[doc = "Get the `srcFactor` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBlendComponent`, `GpuBlendFactor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "srcFactor")] + pub fn get_src_factor(this: &GpuBlendComponent) -> Option; #[doc = "Change the `srcFactor` field of this object."] #[doc = ""] @@ -98,18 +87,38 @@ impl GpuBlendComponent { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "srcFactor")] + pub fn set_src_factor(this: &GpuBlendComponent, val: GpuBlendFactor); +} + +impl GpuBlendComponent { + #[doc = "Construct a new `GpuBlendComponent`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBlendComponent`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new() -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret + } + + #[deprecated = "Use `set_dst_factor()` instead."] + pub fn dst_factor(&mut self, val: GpuBlendFactor) -> &mut Self { + self.set_dst_factor(val); + self + } + + #[deprecated = "Use `set_operation()` instead."] + pub fn operation(&mut self, val: GpuBlendOperation) -> &mut Self { + self.set_operation(val); + self + } + + #[deprecated = "Use `set_src_factor()` instead."] pub fn src_factor(&mut self, val: GpuBlendFactor) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("srcFactor"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_src_factor(val); self } } diff --git a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuBlendFactor.rs b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuBlendFactor.rs index 778b563b92..37b7978da3 100644 --- a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuBlendFactor.rs +++ b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuBlendFactor.rs @@ -18,7 +18,7 @@ // // If you want to improve the generated code, please submit a PR to the https://github.com/rustwasm/wasm-bindgen repository. // -// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.91` command. +// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.97` command. #![allow(unused_imports)] #![allow(clippy::all)] use wasm_bindgen::prelude::*; @@ -45,4 +45,8 @@ pub enum GpuBlendFactor { SrcAlphaSaturated = "src-alpha-saturated", Constant = "constant", OneMinusConstant = "one-minus-constant", + Src1 = "src1", + OneMinusSrc1 = "one-minus-src1", + Src1Alpha = "src1-alpha", + OneMinusSrc1Alpha = "one-minus-src1-alpha", } diff --git a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuBlendOperation.rs b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuBlendOperation.rs index 587cf72091..9ce4393be0 100644 --- a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuBlendOperation.rs +++ b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuBlendOperation.rs @@ -18,7 +18,7 @@ // // If you want to improve the generated code, please submit a PR to the https://github.com/rustwasm/wasm-bindgen repository. // -// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.91` command. +// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.97` command. #![allow(unused_imports)] #![allow(clippy::all)] use wasm_bindgen::prelude::*; diff --git a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuBlendState.rs b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuBlendState.rs index f00d4addae..043460b8a5 100644 --- a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuBlendState.rs +++ b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuBlendState.rs @@ -18,7 +18,7 @@ // // If you want to improve the generated code, please submit a PR to the https://github.com/rustwasm/wasm-bindgen repository. // -// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.91` command. +// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.97` command. #![allow(unused_imports)] #![allow(clippy::all)] use super::*; @@ -35,22 +35,15 @@ extern "C" { #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub type GpuBlendState; -} -impl GpuBlendState { - #[doc = "Construct a new `GpuBlendState`."] + #[doc = "Get the `alpha` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `GpuBlendComponent`, `GpuBlendState`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn new(alpha: &GpuBlendComponent, color: &GpuBlendComponent) -> Self { - #[allow(unused_mut)] - let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); - ret.alpha(alpha); - ret.color(color); - ret - } + #[wasm_bindgen(method, getter = "alpha")] + pub fn get_alpha(this: &GpuBlendState) -> GpuBlendComponent; #[doc = "Change the `alpha` field of this object."] #[doc = ""] @@ -58,16 +51,17 @@ impl GpuBlendState { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn alpha(&mut self, val: &GpuBlendComponent) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("alpha"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "alpha")] + pub fn set_alpha(this: &GpuBlendState, val: &GpuBlendComponent); + + #[doc = "Get the `color` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBlendComponent`, `GpuBlendState`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "color")] + pub fn get_color(this: &GpuBlendState) -> GpuBlendComponent; #[doc = "Change the `color` field of this object."] #[doc = ""] @@ -75,14 +69,34 @@ impl GpuBlendState { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "color")] + pub fn set_color(this: &GpuBlendState, val: &GpuBlendComponent); +} + +impl GpuBlendState { + #[doc = "Construct a new `GpuBlendState`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBlendComponent`, `GpuBlendState`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new(alpha: &GpuBlendComponent, color: &GpuBlendComponent) -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret.set_alpha(alpha); + ret.set_color(color); + ret + } + + #[deprecated = "Use `set_alpha()` instead."] + pub fn alpha(&mut self, val: &GpuBlendComponent) -> &mut Self { + self.set_alpha(val); + self + } + + #[deprecated = "Use `set_color()` instead."] pub fn color(&mut self, val: &GpuBlendComponent) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("color"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_color(val); self } } diff --git a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuBuffer.rs b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuBuffer.rs index 3e6c2aca97..e336ba4fbb 100644 --- a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuBuffer.rs +++ b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuBuffer.rs @@ -18,7 +18,7 @@ // // If you want to improve the generated code, please submit a PR to the https://github.com/rustwasm/wasm-bindgen repository. // -// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.91` command. +// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.97` command. #![allow(unused_imports)] #![allow(clippy::all)] use super::*; @@ -80,7 +80,7 @@ extern "C" { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn label(this: &GpuBuffer) -> String; + pub fn label(this: &GpuBuffer) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "GPUBuffer" , js_name = label)] #[doc = "Setter for the `label` field of this object."] @@ -104,7 +104,7 @@ extern "C" { #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn destroy(this: &GpuBuffer); - # [wasm_bindgen (method , structural , js_class = "GPUBuffer" , js_name = getMappedRange)] + # [wasm_bindgen (catch , method , structural , js_class = "GPUBuffer" , js_name = getMappedRange)] #[doc = "The `getMappedRange()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUBuffer/getMappedRange)"] @@ -113,9 +113,9 @@ extern "C" { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn get_mapped_range(this: &GpuBuffer) -> ::js_sys::ArrayBuffer; + pub fn get_mapped_range(this: &GpuBuffer) -> Result<::js_sys::ArrayBuffer, JsValue>; - # [wasm_bindgen (method , structural , js_class = "GPUBuffer" , js_name = getMappedRange)] + # [wasm_bindgen (catch , method , structural , js_class = "GPUBuffer" , js_name = getMappedRange)] #[doc = "The `getMappedRange()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUBuffer/getMappedRange)"] @@ -124,9 +124,12 @@ extern "C" { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn get_mapped_range_with_u32(this: &GpuBuffer, offset: u32) -> ::js_sys::ArrayBuffer; + pub fn get_mapped_range_with_u32( + this: &GpuBuffer, + offset: u32, + ) -> Result<::js_sys::ArrayBuffer, JsValue>; - # [wasm_bindgen (method , structural , js_class = "GPUBuffer" , js_name = getMappedRange)] + # [wasm_bindgen (catch , method , structural , js_class = "GPUBuffer" , js_name = getMappedRange)] #[doc = "The `getMappedRange()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUBuffer/getMappedRange)"] @@ -135,9 +138,12 @@ extern "C" { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn get_mapped_range_with_f64(this: &GpuBuffer, offset: f64) -> ::js_sys::ArrayBuffer; + pub fn get_mapped_range_with_f64( + this: &GpuBuffer, + offset: f64, + ) -> Result<::js_sys::ArrayBuffer, JsValue>; - # [wasm_bindgen (method , structural , js_class = "GPUBuffer" , js_name = getMappedRange)] + # [wasm_bindgen (catch , method , structural , js_class = "GPUBuffer" , js_name = getMappedRange)] #[doc = "The `getMappedRange()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUBuffer/getMappedRange)"] @@ -150,9 +156,9 @@ extern "C" { this: &GpuBuffer, offset: u32, size: u32, - ) -> ::js_sys::ArrayBuffer; + ) -> Result<::js_sys::ArrayBuffer, JsValue>; - # [wasm_bindgen (method , structural , js_class = "GPUBuffer" , js_name = getMappedRange)] + # [wasm_bindgen (catch , method , structural , js_class = "GPUBuffer" , js_name = getMappedRange)] #[doc = "The `getMappedRange()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUBuffer/getMappedRange)"] @@ -165,9 +171,9 @@ extern "C" { this: &GpuBuffer, offset: f64, size: u32, - ) -> ::js_sys::ArrayBuffer; + ) -> Result<::js_sys::ArrayBuffer, JsValue>; - # [wasm_bindgen (method , structural , js_class = "GPUBuffer" , js_name = getMappedRange)] + # [wasm_bindgen (catch , method , structural , js_class = "GPUBuffer" , js_name = getMappedRange)] #[doc = "The `getMappedRange()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUBuffer/getMappedRange)"] @@ -180,9 +186,9 @@ extern "C" { this: &GpuBuffer, offset: u32, size: f64, - ) -> ::js_sys::ArrayBuffer; + ) -> Result<::js_sys::ArrayBuffer, JsValue>; - # [wasm_bindgen (method , structural , js_class = "GPUBuffer" , js_name = getMappedRange)] + # [wasm_bindgen (catch , method , structural , js_class = "GPUBuffer" , js_name = getMappedRange)] #[doc = "The `getMappedRange()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUBuffer/getMappedRange)"] @@ -195,7 +201,7 @@ extern "C" { this: &GpuBuffer, offset: f64, size: f64, - ) -> ::js_sys::ArrayBuffer; + ) -> Result<::js_sys::ArrayBuffer, JsValue>; # [wasm_bindgen (method , structural , js_class = "GPUBuffer" , js_name = mapAsync)] #[doc = "The `mapAsync()` method."] diff --git a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuBufferBinding.rs b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuBufferBinding.rs index efb03aa711..0e56f2ede6 100644 --- a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuBufferBinding.rs +++ b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuBufferBinding.rs @@ -18,7 +18,7 @@ // // If you want to improve the generated code, please submit a PR to the https://github.com/rustwasm/wasm-bindgen repository. // -// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.91` command. +// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.97` command. #![allow(unused_imports)] #![allow(clippy::all)] use super::*; @@ -35,21 +35,15 @@ extern "C" { #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub type GpuBufferBinding; -} -impl GpuBufferBinding { - #[doc = "Construct a new `GpuBufferBinding`."] + #[doc = "Get the `buffer` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `GpuBuffer`, `GpuBufferBinding`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn new(buffer: &GpuBuffer) -> Self { - #[allow(unused_mut)] - let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); - ret.buffer(buffer); - ret - } + #[wasm_bindgen(method, getter = "buffer")] + pub fn get_buffer(this: &GpuBufferBinding) -> GpuBuffer; #[doc = "Change the `buffer` field of this object."] #[doc = ""] @@ -57,17 +51,17 @@ impl GpuBufferBinding { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn buffer(&mut self, val: &GpuBuffer) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("buffer"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "buffer")] + pub fn set_buffer(this: &GpuBufferBinding, val: &GpuBuffer); + + #[doc = "Get the `offset` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBufferBinding`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "offset")] + pub fn get_offset(this: &GpuBufferBinding) -> Option; #[doc = "Change the `offset` field of this object."] #[doc = ""] @@ -75,17 +69,17 @@ impl GpuBufferBinding { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn offset(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("offset"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "offset")] + pub fn set_offset(this: &GpuBufferBinding, val: f64); + + #[doc = "Get the `size` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBufferBinding`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "size")] + pub fn get_size(this: &GpuBufferBinding) -> Option; #[doc = "Change the `size` field of this object."] #[doc = ""] @@ -93,14 +87,39 @@ impl GpuBufferBinding { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "size")] + pub fn set_size(this: &GpuBufferBinding, val: f64); +} + +impl GpuBufferBinding { + #[doc = "Construct a new `GpuBufferBinding`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBuffer`, `GpuBufferBinding`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new(buffer: &GpuBuffer) -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret.set_buffer(buffer); + ret + } + + #[deprecated = "Use `set_buffer()` instead."] + pub fn buffer(&mut self, val: &GpuBuffer) -> &mut Self { + self.set_buffer(val); + self + } + + #[deprecated = "Use `set_offset()` instead."] + pub fn offset(&mut self, val: f64) -> &mut Self { + self.set_offset(val); + self + } + + #[deprecated = "Use `set_size()` instead."] pub fn size(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("size"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_size(val); self } } diff --git a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuBufferBindingLayout.rs b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuBufferBindingLayout.rs index 46e5ed578a..fb626c9711 100644 --- a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuBufferBindingLayout.rs +++ b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuBufferBindingLayout.rs @@ -18,7 +18,7 @@ // // If you want to improve the generated code, please submit a PR to the https://github.com/rustwasm/wasm-bindgen repository. // -// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.91` command. +// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.97` command. #![allow(unused_imports)] #![allow(clippy::all)] use super::*; @@ -35,20 +35,15 @@ extern "C" { #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub type GpuBufferBindingLayout; -} -impl GpuBufferBindingLayout { - #[doc = "Construct a new `GpuBufferBindingLayout`."] + #[doc = "Get the `hasDynamicOffset` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `GpuBufferBindingLayout`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn new() -> Self { - #[allow(unused_mut)] - let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); - ret - } + #[wasm_bindgen(method, getter = "hasDynamicOffset")] + pub fn get_has_dynamic_offset(this: &GpuBufferBindingLayout) -> Option; #[doc = "Change the `hasDynamicOffset` field of this object."] #[doc = ""] @@ -56,20 +51,17 @@ impl GpuBufferBindingLayout { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn has_dynamic_offset(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("hasDynamicOffset"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "hasDynamicOffset")] + pub fn set_has_dynamic_offset(this: &GpuBufferBindingLayout, val: bool); + + #[doc = "Get the `minBindingSize` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBufferBindingLayout`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "minBindingSize")] + pub fn get_min_binding_size(this: &GpuBufferBindingLayout) -> Option; #[doc = "Change the `minBindingSize` field of this object."] #[doc = ""] @@ -77,20 +69,17 @@ impl GpuBufferBindingLayout { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn min_binding_size(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("minBindingSize"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "minBindingSize")] + pub fn set_min_binding_size(this: &GpuBufferBindingLayout, val: f64); + + #[doc = "Get the `type` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBufferBindingLayout`, `GpuBufferBindingType`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "type")] + pub fn get_type(this: &GpuBufferBindingLayout) -> Option; #[doc = "Change the `type` field of this object."] #[doc = ""] @@ -98,14 +87,38 @@ impl GpuBufferBindingLayout { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "type")] + pub fn set_type(this: &GpuBufferBindingLayout, val: GpuBufferBindingType); +} + +impl GpuBufferBindingLayout { + #[doc = "Construct a new `GpuBufferBindingLayout`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBufferBindingLayout`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new() -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret + } + + #[deprecated = "Use `set_has_dynamic_offset()` instead."] + pub fn has_dynamic_offset(&mut self, val: bool) -> &mut Self { + self.set_has_dynamic_offset(val); + self + } + + #[deprecated = "Use `set_min_binding_size()` instead."] + pub fn min_binding_size(&mut self, val: f64) -> &mut Self { + self.set_min_binding_size(val); + self + } + + #[deprecated = "Use `set_type()` instead."] pub fn type_(&mut self, val: GpuBufferBindingType) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("type"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_type(val); self } } diff --git a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuBufferBindingType.rs b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuBufferBindingType.rs index b9818aabf5..32c345dd31 100644 --- a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuBufferBindingType.rs +++ b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuBufferBindingType.rs @@ -18,7 +18,7 @@ // // If you want to improve the generated code, please submit a PR to the https://github.com/rustwasm/wasm-bindgen repository. // -// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.91` command. +// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.97` command. #![allow(unused_imports)] #![allow(clippy::all)] use wasm_bindgen::prelude::*; diff --git a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuBufferDescriptor.rs b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuBufferDescriptor.rs index 72a5c5fc71..364ec90ef6 100644 --- a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuBufferDescriptor.rs +++ b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuBufferDescriptor.rs @@ -18,7 +18,7 @@ // // If you want to improve the generated code, please submit a PR to the https://github.com/rustwasm/wasm-bindgen repository. // -// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.91` command. +// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.97` command. #![allow(unused_imports)] #![allow(clippy::all)] use super::*; @@ -35,22 +35,15 @@ extern "C" { #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub type GpuBufferDescriptor; -} -impl GpuBufferDescriptor { - #[doc = "Construct a new `GpuBufferDescriptor`."] + #[doc = "Get the `label` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `GpuBufferDescriptor`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn new(size: f64, usage: u32) -> Self { - #[allow(unused_mut)] - let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); - ret.size(size); - ret.usage(usage); - ret - } + #[wasm_bindgen(method, getter = "label")] + pub fn get_label(this: &GpuBufferDescriptor) -> Option<::alloc::string::String>; #[doc = "Change the `label` field of this object."] #[doc = ""] @@ -58,16 +51,17 @@ impl GpuBufferDescriptor { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn label(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("label"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "label")] + pub fn set_label(this: &GpuBufferDescriptor, val: &str); + + #[doc = "Get the `mappedAtCreation` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBufferDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "mappedAtCreation")] + pub fn get_mapped_at_creation(this: &GpuBufferDescriptor) -> Option; #[doc = "Change the `mappedAtCreation` field of this object."] #[doc = ""] @@ -75,20 +69,17 @@ impl GpuBufferDescriptor { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn mapped_at_creation(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("mappedAtCreation"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "mappedAtCreation")] + pub fn set_mapped_at_creation(this: &GpuBufferDescriptor, val: bool); + + #[doc = "Get the `size` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBufferDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "size")] + pub fn get_size(this: &GpuBufferDescriptor) -> f64; #[doc = "Change the `size` field of this object."] #[doc = ""] @@ -96,16 +87,17 @@ impl GpuBufferDescriptor { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn size(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("size"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "size")] + pub fn set_size(this: &GpuBufferDescriptor, val: f64); + + #[doc = "Get the `usage` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBufferDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "usage")] + pub fn get_usage(this: &GpuBufferDescriptor) -> u32; #[doc = "Change the `usage` field of this object."] #[doc = ""] @@ -113,14 +105,46 @@ impl GpuBufferDescriptor { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "usage")] + pub fn set_usage(this: &GpuBufferDescriptor, val: u32); +} + +impl GpuBufferDescriptor { + #[doc = "Construct a new `GpuBufferDescriptor`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBufferDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new(size: f64, usage: u32) -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret.set_size(size); + ret.set_usage(usage); + ret + } + + #[deprecated = "Use `set_label()` instead."] + pub fn label(&mut self, val: &str) -> &mut Self { + self.set_label(val); + self + } + + #[deprecated = "Use `set_mapped_at_creation()` instead."] + pub fn mapped_at_creation(&mut self, val: bool) -> &mut Self { + self.set_mapped_at_creation(val); + self + } + + #[deprecated = "Use `set_size()` instead."] + pub fn size(&mut self, val: f64) -> &mut Self { + self.set_size(val); + self + } + + #[deprecated = "Use `set_usage()` instead."] pub fn usage(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("usage"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_usage(val); self } } diff --git a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuBufferMapState.rs b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuBufferMapState.rs index 385fe8a4bd..ef5843a1eb 100644 --- a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuBufferMapState.rs +++ b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuBufferMapState.rs @@ -18,7 +18,7 @@ // // If you want to improve the generated code, please submit a PR to the https://github.com/rustwasm/wasm-bindgen repository. // -// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.91` command. +// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.97` command. #![allow(unused_imports)] #![allow(clippy::all)] use wasm_bindgen::prelude::*; diff --git a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuCanvasAlphaMode.rs b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuCanvasAlphaMode.rs index 2149140497..2f05cc060f 100644 --- a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuCanvasAlphaMode.rs +++ b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuCanvasAlphaMode.rs @@ -18,7 +18,7 @@ // // If you want to improve the generated code, please submit a PR to the https://github.com/rustwasm/wasm-bindgen repository. // -// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.91` command. +// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.97` command. #![allow(unused_imports)] #![allow(clippy::all)] use wasm_bindgen::prelude::*; diff --git a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuCanvasConfiguration.rs b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuCanvasConfiguration.rs index 4af8e72202..383ea0e26d 100644 --- a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuCanvasConfiguration.rs +++ b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuCanvasConfiguration.rs @@ -18,7 +18,7 @@ // // If you want to improve the generated code, please submit a PR to the https://github.com/rustwasm/wasm-bindgen repository. // -// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.91` command. +// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.97` command. #![allow(unused_imports)] #![allow(clippy::all)] use super::*; @@ -35,22 +35,15 @@ extern "C" { #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub type GpuCanvasConfiguration; -} -impl GpuCanvasConfiguration { - #[doc = "Construct a new `GpuCanvasConfiguration`."] + #[doc = "Get the `alphaMode` field of this object."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuCanvasConfiguration`, `GpuDevice`, `GpuTextureFormat`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuCanvasAlphaMode`, `GpuCanvasConfiguration`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn new(device: &GpuDevice, format: GpuTextureFormat) -> Self { - #[allow(unused_mut)] - let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); - ret.device(device); - ret.format(format); - ret - } + #[wasm_bindgen(method, getter = "alphaMode")] + pub fn get_alpha_mode(this: &GpuCanvasConfiguration) -> Option; #[doc = "Change the `alphaMode` field of this object."] #[doc = ""] @@ -58,20 +51,17 @@ impl GpuCanvasConfiguration { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn alpha_mode(&mut self, val: GpuCanvasAlphaMode) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("alphaMode"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "alphaMode")] + pub fn set_alpha_mode(this: &GpuCanvasConfiguration, val: GpuCanvasAlphaMode); + + #[doc = "Get the `device` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuCanvasConfiguration`, `GpuDevice`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "device")] + pub fn get_device(this: &GpuCanvasConfiguration) -> GpuDevice; #[doc = "Change the `device` field of this object."] #[doc = ""] @@ -79,17 +69,17 @@ impl GpuCanvasConfiguration { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn device(&mut self, val: &GpuDevice) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("device"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "device")] + pub fn set_device(this: &GpuCanvasConfiguration, val: &GpuDevice); + + #[doc = "Get the `format` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuCanvasConfiguration`, `GpuTextureFormat`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "format")] + pub fn get_format(this: &GpuCanvasConfiguration) -> GpuTextureFormat; #[doc = "Change the `format` field of this object."] #[doc = ""] @@ -97,17 +87,35 @@ impl GpuCanvasConfiguration { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn format(&mut self, val: GpuTextureFormat) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("format"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "format")] + pub fn set_format(this: &GpuCanvasConfiguration, val: GpuTextureFormat); + + #[doc = "Get the `toneMapping` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuCanvasConfiguration`, `GpuCanvasToneMapping`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "toneMapping")] + pub fn get_tone_mapping(this: &GpuCanvasConfiguration) -> Option; + + #[doc = "Change the `toneMapping` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuCanvasConfiguration`, `GpuCanvasToneMapping`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "toneMapping")] + pub fn set_tone_mapping(this: &GpuCanvasConfiguration, val: &GpuCanvasToneMapping); + + #[doc = "Get the `usage` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuCanvasConfiguration`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "usage")] + pub fn get_usage(this: &GpuCanvasConfiguration) -> Option; #[doc = "Change the `usage` field of this object."] #[doc = ""] @@ -115,16 +123,17 @@ impl GpuCanvasConfiguration { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn usage(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("usage"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "usage")] + pub fn set_usage(this: &GpuCanvasConfiguration, val: u32); + + #[doc = "Get the `viewFormats` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuCanvasConfiguration`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "viewFormats")] + pub fn get_view_formats(this: &GpuCanvasConfiguration) -> Option<::js_sys::Array>; #[doc = "Change the `viewFormats` field of this object."] #[doc = ""] @@ -132,18 +141,58 @@ impl GpuCanvasConfiguration { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "viewFormats")] + pub fn set_view_formats(this: &GpuCanvasConfiguration, val: &::wasm_bindgen::JsValue); +} + +impl GpuCanvasConfiguration { + #[doc = "Construct a new `GpuCanvasConfiguration`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuCanvasConfiguration`, `GpuDevice`, `GpuTextureFormat`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new(device: &GpuDevice, format: GpuTextureFormat) -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret.set_device(device); + ret.set_format(format); + ret + } + + #[deprecated = "Use `set_alpha_mode()` instead."] + pub fn alpha_mode(&mut self, val: GpuCanvasAlphaMode) -> &mut Self { + self.set_alpha_mode(val); + self + } + + #[deprecated = "Use `set_device()` instead."] + pub fn device(&mut self, val: &GpuDevice) -> &mut Self { + self.set_device(val); + self + } + + #[deprecated = "Use `set_format()` instead."] + pub fn format(&mut self, val: GpuTextureFormat) -> &mut Self { + self.set_format(val); + self + } + + #[deprecated = "Use `set_tone_mapping()` instead."] + pub fn tone_mapping(&mut self, val: &GpuCanvasToneMapping) -> &mut Self { + self.set_tone_mapping(val); + self + } + + #[deprecated = "Use `set_usage()` instead."] + pub fn usage(&mut self, val: u32) -> &mut Self { + self.set_usage(val); + self + } + + #[deprecated = "Use `set_view_formats()` instead."] pub fn view_formats(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("viewFormats"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_view_formats(val); self } } diff --git a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuCanvasContext.rs b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuCanvasContext.rs index 204a08dd8e..b9a006bac3 100644 --- a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuCanvasContext.rs +++ b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuCanvasContext.rs @@ -18,7 +18,7 @@ // // If you want to improve the generated code, please submit a PR to the https://github.com/rustwasm/wasm-bindgen repository. // -// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.91` command. +// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.97` command. #![allow(unused_imports)] #![allow(clippy::all)] use super::*; @@ -49,7 +49,7 @@ extern "C" { #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn canvas(this: &GpuCanvasContext) -> ::js_sys::Object; - # [wasm_bindgen (method , structural , js_class = "GPUCanvasContext" , js_name = configure)] + # [wasm_bindgen (catch , method , structural , js_class = "GPUCanvasContext" , js_name = configure)] #[doc = "The `configure()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUCanvasContext/configure)"] @@ -58,9 +58,23 @@ extern "C" { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn configure(this: &GpuCanvasContext, configuration: &GpuCanvasConfiguration); + pub fn configure( + this: &GpuCanvasContext, + configuration: &GpuCanvasConfiguration, + ) -> Result<(), JsValue>; - # [wasm_bindgen (method , structural , js_class = "GPUCanvasContext" , js_name = getCurrentTexture)] + # [wasm_bindgen (method , structural , js_class = "GPUCanvasContext" , js_name = getConfiguration)] + #[doc = "The `getConfiguration()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUCanvasContext/getConfiguration)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuCanvasConfiguration`, `GpuCanvasContext`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn get_configuration(this: &GpuCanvasContext) -> Option; + + # [wasm_bindgen (catch , method , structural , js_class = "GPUCanvasContext" , js_name = getCurrentTexture)] #[doc = "The `getCurrentTexture()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUCanvasContext/getCurrentTexture)"] @@ -69,7 +83,7 @@ extern "C" { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn get_current_texture(this: &GpuCanvasContext) -> GpuTexture; + pub fn get_current_texture(this: &GpuCanvasContext) -> Result; # [wasm_bindgen (method , structural , js_class = "GPUCanvasContext" , js_name = unconfigure)] #[doc = "The `unconfigure()` method."] diff --git a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuImageDataLayout.rs b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuCanvasToneMapping.rs similarity index 56% rename from wgpu/src/backend/webgpu/webgpu_sys/gen_GpuImageDataLayout.rs rename to wgpu/src/backend/webgpu/webgpu_sys/gen_GpuCanvasToneMapping.rs index 3d19ec8b42..899f956083 100644 --- a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuImageDataLayout.rs +++ b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuCanvasToneMapping.rs @@ -18,7 +18,7 @@ // // If you want to improve the generated code, please submit a PR to the https://github.com/rustwasm/wasm-bindgen repository. // -// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.91` command. +// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.97` command. #![allow(unused_imports)] #![allow(clippy::all)] use super::*; @@ -26,92 +26,56 @@ use wasm_bindgen::prelude::*; #[wasm_bindgen] extern "C" { - # [wasm_bindgen (extends = :: js_sys :: Object , js_name = GPUImageDataLayout)] + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = GPUCanvasToneMapping)] #[derive(Debug, Clone, PartialEq, Eq)] - #[doc = "The `GpuImageDataLayout` dictionary."] + #[doc = "The `GpuCanvasToneMapping` dictionary."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuImageDataLayout`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuCanvasToneMapping`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub type GpuImageDataLayout; -} + pub type GpuCanvasToneMapping; -impl GpuImageDataLayout { - #[doc = "Construct a new `GpuImageDataLayout`."] + #[doc = "Get the `mode` field of this object."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuImageDataLayout`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuCanvasToneMapping`, `GpuCanvasToneMappingMode`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn new() -> Self { - #[allow(unused_mut)] - let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); - ret - } + #[wasm_bindgen(method, getter = "mode")] + pub fn get_mode(this: &GpuCanvasToneMapping) -> Option; - #[doc = "Change the `bytesPerRow` field of this object."] + #[doc = "Change the `mode` field of this object."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuImageDataLayout`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuCanvasToneMapping`, `GpuCanvasToneMappingMode`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn bytes_per_row(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("bytesPerRow"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "mode")] + pub fn set_mode(this: &GpuCanvasToneMapping, val: GpuCanvasToneMappingMode); +} - #[doc = "Change the `offset` field of this object."] +impl GpuCanvasToneMapping { + #[doc = "Construct a new `GpuCanvasToneMapping`."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuImageDataLayout`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuCanvasToneMapping`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn offset(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("offset"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self + pub fn new() -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret } - #[doc = "Change the `rowsPerImage` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuImageDataLayout`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn rows_per_image(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("rowsPerImage"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + #[deprecated = "Use `set_mode()` instead."] + pub fn mode(&mut self, val: GpuCanvasToneMappingMode) -> &mut Self { + self.set_mode(val); self } } -impl Default for GpuImageDataLayout { +impl Default for GpuCanvasToneMapping { fn default() -> Self { Self::new() } diff --git a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuCanvasToneMappingMode.rs b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuCanvasToneMappingMode.rs new file mode 100644 index 0000000000..efe6985b07 --- /dev/null +++ b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuCanvasToneMappingMode.rs @@ -0,0 +1,37 @@ +// DO NOT EDIT THIS FILE! +// +// This module part of a subset of web-sys that is used by wgpu's webgpu backend. +// +// These bindings are vendored into wgpu for the sole purpose of letting +// us pin the WebGPU backend to a specific version of the bindings, not +// to enable local changes. There are no provisions to preserve changes +// you make here the next time we re-vendor the bindings. +// +// The `web-sys` crate does not treat breaking changes to the WebGPU API +// as semver breaking changes, as WebGPU is "unstable". This means Cargo +// will not let us mix versions of `web-sys`, pinning WebGPU bindings to +// a specific version, while letting other bindings like WebGL get +// updated. Vendoring WebGPU was the workaround we chose. +// +// Vendoring also allows us to avoid building `web-sys` with +// `--cfg=web_sys_unstable_apis`, needed to get the WebGPU bindings. +// +// If you want to improve the generated code, please submit a PR to the https://github.com/rustwasm/wasm-bindgen repository. +// +// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.97` command. +#![allow(unused_imports)] +#![allow(clippy::all)] +use wasm_bindgen::prelude::*; + +#[wasm_bindgen] +#[doc = "The `GpuCanvasToneMappingMode` enum."] +#[doc = ""] +#[doc = "*This API requires the following crate features to be activated: `GpuCanvasToneMappingMode`*"] +#[doc = ""] +#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] +#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] +#[derive(Debug, Clone, Copy, PartialEq, Eq)] +pub enum GpuCanvasToneMappingMode { + Standard = "standard", + Extended = "extended", +} diff --git a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuColorDict.rs b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuColorDict.rs index 4e29fbd199..96117f7199 100644 --- a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuColorDict.rs +++ b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuColorDict.rs @@ -18,7 +18,7 @@ // // If you want to improve the generated code, please submit a PR to the https://github.com/rustwasm/wasm-bindgen repository. // -// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.91` command. +// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.97` command. #![allow(unused_imports)] #![allow(clippy::all)] use super::*; @@ -35,24 +35,15 @@ extern "C" { #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub type GpuColorDict; -} -impl GpuColorDict { - #[doc = "Construct a new `GpuColorDict`."] + #[doc = "Get the `a` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `GpuColorDict`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn new(a: f64, b: f64, g: f64, r: f64) -> Self { - #[allow(unused_mut)] - let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); - ret.a(a); - ret.b(b); - ret.g(g); - ret.r(r); - ret - } + #[wasm_bindgen(method, getter = "a")] + pub fn get_a(this: &GpuColorDict) -> f64; #[doc = "Change the `a` field of this object."] #[doc = ""] @@ -60,16 +51,17 @@ impl GpuColorDict { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn a(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("a"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "a")] + pub fn set_a(this: &GpuColorDict, val: f64); + + #[doc = "Get the `b` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuColorDict`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "b")] + pub fn get_b(this: &GpuColorDict) -> f64; #[doc = "Change the `b` field of this object."] #[doc = ""] @@ -77,16 +69,17 @@ impl GpuColorDict { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn b(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("b"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "b")] + pub fn set_b(this: &GpuColorDict, val: f64); + + #[doc = "Get the `g` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuColorDict`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "g")] + pub fn get_g(this: &GpuColorDict) -> f64; #[doc = "Change the `g` field of this object."] #[doc = ""] @@ -94,16 +87,17 @@ impl GpuColorDict { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn g(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("g"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "g")] + pub fn set_g(this: &GpuColorDict, val: f64); + + #[doc = "Get the `r` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuColorDict`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "r")] + pub fn get_r(this: &GpuColorDict) -> f64; #[doc = "Change the `r` field of this object."] #[doc = ""] @@ -111,14 +105,48 @@ impl GpuColorDict { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "r")] + pub fn set_r(this: &GpuColorDict, val: f64); +} + +impl GpuColorDict { + #[doc = "Construct a new `GpuColorDict`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuColorDict`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new(a: f64, b: f64, g: f64, r: f64) -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret.set_a(a); + ret.set_b(b); + ret.set_g(g); + ret.set_r(r); + ret + } + + #[deprecated = "Use `set_a()` instead."] + pub fn a(&mut self, val: f64) -> &mut Self { + self.set_a(val); + self + } + + #[deprecated = "Use `set_b()` instead."] + pub fn b(&mut self, val: f64) -> &mut Self { + self.set_b(val); + self + } + + #[deprecated = "Use `set_g()` instead."] + pub fn g(&mut self, val: f64) -> &mut Self { + self.set_g(val); + self + } + + #[deprecated = "Use `set_r()` instead."] pub fn r(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("r"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_r(val); self } } diff --git a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuColorTargetState.rs b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuColorTargetState.rs index 533b2a3fb0..8645107749 100644 --- a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuColorTargetState.rs +++ b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuColorTargetState.rs @@ -18,7 +18,7 @@ // // If you want to improve the generated code, please submit a PR to the https://github.com/rustwasm/wasm-bindgen repository. // -// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.91` command. +// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.97` command. #![allow(unused_imports)] #![allow(clippy::all)] use super::*; @@ -35,21 +35,15 @@ extern "C" { #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub type GpuColorTargetState; -} -impl GpuColorTargetState { - #[doc = "Construct a new `GpuColorTargetState`."] + #[doc = "Get the `blend` field of this object."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuColorTargetState`, `GpuTextureFormat`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuBlendState`, `GpuColorTargetState`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn new(format: GpuTextureFormat) -> Self { - #[allow(unused_mut)] - let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); - ret.format(format); - ret - } + #[wasm_bindgen(method, getter = "blend")] + pub fn get_blend(this: &GpuColorTargetState) -> Option; #[doc = "Change the `blend` field of this object."] #[doc = ""] @@ -57,16 +51,17 @@ impl GpuColorTargetState { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn blend(&mut self, val: &GpuBlendState) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("blend"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "blend")] + pub fn set_blend(this: &GpuColorTargetState, val: &GpuBlendState); + + #[doc = "Get the `format` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuColorTargetState`, `GpuTextureFormat`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "format")] + pub fn get_format(this: &GpuColorTargetState) -> GpuTextureFormat; #[doc = "Change the `format` field of this object."] #[doc = ""] @@ -74,17 +69,17 @@ impl GpuColorTargetState { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn format(&mut self, val: GpuTextureFormat) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("format"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "format")] + pub fn set_format(this: &GpuColorTargetState, val: GpuTextureFormat); + + #[doc = "Get the `writeMask` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuColorTargetState`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "writeMask")] + pub fn get_write_mask(this: &GpuColorTargetState) -> Option; #[doc = "Change the `writeMask` field of this object."] #[doc = ""] @@ -92,18 +87,39 @@ impl GpuColorTargetState { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "writeMask")] + pub fn set_write_mask(this: &GpuColorTargetState, val: u32); +} + +impl GpuColorTargetState { + #[doc = "Construct a new `GpuColorTargetState`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuColorTargetState`, `GpuTextureFormat`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new(format: GpuTextureFormat) -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret.set_format(format); + ret + } + + #[deprecated = "Use `set_blend()` instead."] + pub fn blend(&mut self, val: &GpuBlendState) -> &mut Self { + self.set_blend(val); + self + } + + #[deprecated = "Use `set_format()` instead."] + pub fn format(&mut self, val: GpuTextureFormat) -> &mut Self { + self.set_format(val); + self + } + + #[deprecated = "Use `set_write_mask()` instead."] pub fn write_mask(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("writeMask"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_write_mask(val); self } } diff --git a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuCommandBuffer.rs b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuCommandBuffer.rs index 9d2eacdeb5..dabe282b66 100644 --- a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuCommandBuffer.rs +++ b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuCommandBuffer.rs @@ -18,7 +18,7 @@ // // If you want to improve the generated code, please submit a PR to the https://github.com/rustwasm/wasm-bindgen repository. // -// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.91` command. +// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.97` command. #![allow(unused_imports)] #![allow(clippy::all)] use super::*; @@ -47,7 +47,7 @@ extern "C" { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn label(this: &GpuCommandBuffer) -> String; + pub fn label(this: &GpuCommandBuffer) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "GPUCommandBuffer" , js_name = label)] #[doc = "Setter for the `label` field of this object."] diff --git a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuCommandBufferDescriptor.rs b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuCommandBufferDescriptor.rs index 818ac0a6e0..b3b55f506b 100644 --- a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuCommandBufferDescriptor.rs +++ b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuCommandBufferDescriptor.rs @@ -18,7 +18,7 @@ // // If you want to improve the generated code, please submit a PR to the https://github.com/rustwasm/wasm-bindgen repository. // -// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.91` command. +// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.97` command. #![allow(unused_imports)] #![allow(clippy::all)] use super::*; @@ -35,6 +35,24 @@ extern "C" { #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub type GpuCommandBufferDescriptor; + + #[doc = "Get the `label` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuCommandBufferDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "label")] + pub fn get_label(this: &GpuCommandBufferDescriptor) -> Option<::alloc::string::String>; + + #[doc = "Change the `label` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuCommandBufferDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "label")] + pub fn set_label(this: &GpuCommandBufferDescriptor, val: &str); } impl GpuCommandBufferDescriptor { @@ -50,20 +68,9 @@ impl GpuCommandBufferDescriptor { ret } - #[doc = "Change the `label` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuCommandBufferDescriptor`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[deprecated = "Use `set_label()` instead."] pub fn label(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("label"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_label(val); self } } diff --git a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuCommandEncoder.rs b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuCommandEncoder.rs index 9b6b7924a3..604b5de656 100644 --- a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuCommandEncoder.rs +++ b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuCommandEncoder.rs @@ -18,7 +18,7 @@ // // If you want to improve the generated code, please submit a PR to the https://github.com/rustwasm/wasm-bindgen repository. // -// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.91` command. +// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.97` command. #![allow(unused_imports)] #![allow(clippy::all)] use super::*; @@ -47,7 +47,7 @@ extern "C" { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn label(this: &GpuCommandEncoder) -> String; + pub fn label(this: &GpuCommandEncoder) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "GPUCommandEncoder" , js_name = label)] #[doc = "Setter for the `label` field of this object."] @@ -85,7 +85,7 @@ extern "C" { descriptor: &GpuComputePassDescriptor, ) -> GpuComputePassEncoder; - # [wasm_bindgen (method , structural , js_class = "GPUCommandEncoder" , js_name = beginRenderPass)] + # [wasm_bindgen (catch , method , structural , js_class = "GPUCommandEncoder" , js_name = beginRenderPass)] #[doc = "The `beginRenderPass()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUCommandEncoder/beginRenderPass)"] @@ -97,7 +97,7 @@ extern "C" { pub fn begin_render_pass( this: &GpuCommandEncoder, descriptor: &GpuRenderPassDescriptor, - ) -> GpuRenderPassEncoder; + ) -> Result; # [wasm_bindgen (method , structural , js_class = "GPUCommandEncoder" , js_name = clearBuffer)] #[doc = "The `clearBuffer()` method."] @@ -196,7 +196,7 @@ extern "C" { size: f64, ); - # [wasm_bindgen (method , structural , js_class = "GPUCommandEncoder" , js_name = copyBufferToBuffer)] + # [wasm_bindgen (catch , method , structural , js_class = "GPUCommandEncoder" , js_name = copyBufferToBuffer)] #[doc = "The `copyBufferToBuffer()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUCommandEncoder/copyBufferToBuffer)"] @@ -212,9 +212,9 @@ extern "C" { destination: &GpuBuffer, destination_offset: u32, size: u32, - ); + ) -> Result<(), JsValue>; - # [wasm_bindgen (method , structural , js_class = "GPUCommandEncoder" , js_name = copyBufferToBuffer)] + # [wasm_bindgen (catch , method , structural , js_class = "GPUCommandEncoder" , js_name = copyBufferToBuffer)] #[doc = "The `copyBufferToBuffer()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUCommandEncoder/copyBufferToBuffer)"] @@ -230,9 +230,9 @@ extern "C" { destination: &GpuBuffer, destination_offset: u32, size: u32, - ); + ) -> Result<(), JsValue>; - # [wasm_bindgen (method , structural , js_class = "GPUCommandEncoder" , js_name = copyBufferToBuffer)] + # [wasm_bindgen (catch , method , structural , js_class = "GPUCommandEncoder" , js_name = copyBufferToBuffer)] #[doc = "The `copyBufferToBuffer()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUCommandEncoder/copyBufferToBuffer)"] @@ -248,9 +248,9 @@ extern "C" { destination: &GpuBuffer, destination_offset: f64, size: u32, - ); + ) -> Result<(), JsValue>; - # [wasm_bindgen (method , structural , js_class = "GPUCommandEncoder" , js_name = copyBufferToBuffer)] + # [wasm_bindgen (catch , method , structural , js_class = "GPUCommandEncoder" , js_name = copyBufferToBuffer)] #[doc = "The `copyBufferToBuffer()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUCommandEncoder/copyBufferToBuffer)"] @@ -266,9 +266,9 @@ extern "C" { destination: &GpuBuffer, destination_offset: f64, size: u32, - ); + ) -> Result<(), JsValue>; - # [wasm_bindgen (method , structural , js_class = "GPUCommandEncoder" , js_name = copyBufferToBuffer)] + # [wasm_bindgen (catch , method , structural , js_class = "GPUCommandEncoder" , js_name = copyBufferToBuffer)] #[doc = "The `copyBufferToBuffer()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUCommandEncoder/copyBufferToBuffer)"] @@ -284,9 +284,9 @@ extern "C" { destination: &GpuBuffer, destination_offset: u32, size: f64, - ); + ) -> Result<(), JsValue>; - # [wasm_bindgen (method , structural , js_class = "GPUCommandEncoder" , js_name = copyBufferToBuffer)] + # [wasm_bindgen (catch , method , structural , js_class = "GPUCommandEncoder" , js_name = copyBufferToBuffer)] #[doc = "The `copyBufferToBuffer()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUCommandEncoder/copyBufferToBuffer)"] @@ -302,9 +302,9 @@ extern "C" { destination: &GpuBuffer, destination_offset: u32, size: f64, - ); + ) -> Result<(), JsValue>; - # [wasm_bindgen (method , structural , js_class = "GPUCommandEncoder" , js_name = copyBufferToBuffer)] + # [wasm_bindgen (catch , method , structural , js_class = "GPUCommandEncoder" , js_name = copyBufferToBuffer)] #[doc = "The `copyBufferToBuffer()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUCommandEncoder/copyBufferToBuffer)"] @@ -320,9 +320,9 @@ extern "C" { destination: &GpuBuffer, destination_offset: f64, size: f64, - ); + ) -> Result<(), JsValue>; - # [wasm_bindgen (method , structural , js_class = "GPUCommandEncoder" , js_name = copyBufferToBuffer)] + # [wasm_bindgen (catch , method , structural , js_class = "GPUCommandEncoder" , js_name = copyBufferToBuffer)] #[doc = "The `copyBufferToBuffer()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUCommandEncoder/copyBufferToBuffer)"] @@ -338,103 +338,103 @@ extern "C" { destination: &GpuBuffer, destination_offset: f64, size: f64, - ); + ) -> Result<(), JsValue>; - # [wasm_bindgen (method , structural , js_class = "GPUCommandEncoder" , js_name = copyBufferToTexture)] + # [wasm_bindgen (catch , method , structural , js_class = "GPUCommandEncoder" , js_name = copyBufferToTexture)] #[doc = "The `copyBufferToTexture()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUCommandEncoder/copyBufferToTexture)"] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuCommandEncoder`, `GpuImageCopyBuffer`, `GpuImageCopyTexture`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuCommandEncoder`, `GpuTexelCopyBufferInfo`, `GpuTexelCopyTextureInfo`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn copy_buffer_to_texture_with_u32_sequence( this: &GpuCommandEncoder, - source: &GpuImageCopyBuffer, - destination: &GpuImageCopyTexture, + source: &GpuTexelCopyBufferInfo, + destination: &GpuTexelCopyTextureInfo, copy_size: &::wasm_bindgen::JsValue, - ); + ) -> Result<(), JsValue>; - # [wasm_bindgen (method , structural , js_class = "GPUCommandEncoder" , js_name = copyBufferToTexture)] + # [wasm_bindgen (catch , method , structural , js_class = "GPUCommandEncoder" , js_name = copyBufferToTexture)] #[doc = "The `copyBufferToTexture()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUCommandEncoder/copyBufferToTexture)"] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuCommandEncoder`, `GpuExtent3dDict`, `GpuImageCopyBuffer`, `GpuImageCopyTexture`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuCommandEncoder`, `GpuExtent3dDict`, `GpuTexelCopyBufferInfo`, `GpuTexelCopyTextureInfo`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn copy_buffer_to_texture_with_gpu_extent_3d_dict( this: &GpuCommandEncoder, - source: &GpuImageCopyBuffer, - destination: &GpuImageCopyTexture, + source: &GpuTexelCopyBufferInfo, + destination: &GpuTexelCopyTextureInfo, copy_size: &GpuExtent3dDict, - ); + ) -> Result<(), JsValue>; - # [wasm_bindgen (method , structural , js_class = "GPUCommandEncoder" , js_name = copyTextureToBuffer)] + # [wasm_bindgen (catch , method , structural , js_class = "GPUCommandEncoder" , js_name = copyTextureToBuffer)] #[doc = "The `copyTextureToBuffer()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUCommandEncoder/copyTextureToBuffer)"] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuCommandEncoder`, `GpuImageCopyBuffer`, `GpuImageCopyTexture`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuCommandEncoder`, `GpuTexelCopyBufferInfo`, `GpuTexelCopyTextureInfo`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn copy_texture_to_buffer_with_u32_sequence( this: &GpuCommandEncoder, - source: &GpuImageCopyTexture, - destination: &GpuImageCopyBuffer, + source: &GpuTexelCopyTextureInfo, + destination: &GpuTexelCopyBufferInfo, copy_size: &::wasm_bindgen::JsValue, - ); + ) -> Result<(), JsValue>; - # [wasm_bindgen (method , structural , js_class = "GPUCommandEncoder" , js_name = copyTextureToBuffer)] + # [wasm_bindgen (catch , method , structural , js_class = "GPUCommandEncoder" , js_name = copyTextureToBuffer)] #[doc = "The `copyTextureToBuffer()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUCommandEncoder/copyTextureToBuffer)"] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuCommandEncoder`, `GpuExtent3dDict`, `GpuImageCopyBuffer`, `GpuImageCopyTexture`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuCommandEncoder`, `GpuExtent3dDict`, `GpuTexelCopyBufferInfo`, `GpuTexelCopyTextureInfo`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn copy_texture_to_buffer_with_gpu_extent_3d_dict( this: &GpuCommandEncoder, - source: &GpuImageCopyTexture, - destination: &GpuImageCopyBuffer, + source: &GpuTexelCopyTextureInfo, + destination: &GpuTexelCopyBufferInfo, copy_size: &GpuExtent3dDict, - ); + ) -> Result<(), JsValue>; - # [wasm_bindgen (method , structural , js_class = "GPUCommandEncoder" , js_name = copyTextureToTexture)] + # [wasm_bindgen (catch , method , structural , js_class = "GPUCommandEncoder" , js_name = copyTextureToTexture)] #[doc = "The `copyTextureToTexture()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUCommandEncoder/copyTextureToTexture)"] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuCommandEncoder`, `GpuImageCopyTexture`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuCommandEncoder`, `GpuTexelCopyTextureInfo`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn copy_texture_to_texture_with_u32_sequence( this: &GpuCommandEncoder, - source: &GpuImageCopyTexture, - destination: &GpuImageCopyTexture, + source: &GpuTexelCopyTextureInfo, + destination: &GpuTexelCopyTextureInfo, copy_size: &::wasm_bindgen::JsValue, - ); + ) -> Result<(), JsValue>; - # [wasm_bindgen (method , structural , js_class = "GPUCommandEncoder" , js_name = copyTextureToTexture)] + # [wasm_bindgen (catch , method , structural , js_class = "GPUCommandEncoder" , js_name = copyTextureToTexture)] #[doc = "The `copyTextureToTexture()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUCommandEncoder/copyTextureToTexture)"] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuCommandEncoder`, `GpuExtent3dDict`, `GpuImageCopyTexture`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuCommandEncoder`, `GpuExtent3dDict`, `GpuTexelCopyTextureInfo`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn copy_texture_to_texture_with_gpu_extent_3d_dict( this: &GpuCommandEncoder, - source: &GpuImageCopyTexture, - destination: &GpuImageCopyTexture, + source: &GpuTexelCopyTextureInfo, + destination: &GpuTexelCopyTextureInfo, copy_size: &GpuExtent3dDict, - ); + ) -> Result<(), JsValue>; # [wasm_bindgen (method , structural , js_class = "GPUCommandEncoder" , js_name = finish)] #[doc = "The `finish()` method."] diff --git a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuCommandEncoderDescriptor.rs b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuCommandEncoderDescriptor.rs index 39b4c69e61..3b6d9c8d89 100644 --- a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuCommandEncoderDescriptor.rs +++ b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuCommandEncoderDescriptor.rs @@ -18,7 +18,7 @@ // // If you want to improve the generated code, please submit a PR to the https://github.com/rustwasm/wasm-bindgen repository. // -// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.91` command. +// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.97` command. #![allow(unused_imports)] #![allow(clippy::all)] use super::*; @@ -35,6 +35,24 @@ extern "C" { #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub type GpuCommandEncoderDescriptor; + + #[doc = "Get the `label` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuCommandEncoderDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "label")] + pub fn get_label(this: &GpuCommandEncoderDescriptor) -> Option<::alloc::string::String>; + + #[doc = "Change the `label` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuCommandEncoderDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "label")] + pub fn set_label(this: &GpuCommandEncoderDescriptor, val: &str); } impl GpuCommandEncoderDescriptor { @@ -50,20 +68,9 @@ impl GpuCommandEncoderDescriptor { ret } - #[doc = "Change the `label` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuCommandEncoderDescriptor`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[deprecated = "Use `set_label()` instead."] pub fn label(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("label"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_label(val); self } } diff --git a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuCompareFunction.rs b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuCompareFunction.rs index 0988524d98..615f82de95 100644 --- a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuCompareFunction.rs +++ b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuCompareFunction.rs @@ -18,7 +18,7 @@ // // If you want to improve the generated code, please submit a PR to the https://github.com/rustwasm/wasm-bindgen repository. // -// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.91` command. +// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.97` command. #![allow(unused_imports)] #![allow(clippy::all)] use wasm_bindgen::prelude::*; diff --git a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuCompilationInfo.rs b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuCompilationInfo.rs index 2667758e7d..b2a4c17224 100644 --- a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuCompilationInfo.rs +++ b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuCompilationInfo.rs @@ -18,7 +18,7 @@ // // If you want to improve the generated code, please submit a PR to the https://github.com/rustwasm/wasm-bindgen repository. // -// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.91` command. +// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.97` command. #![allow(unused_imports)] #![allow(clippy::all)] use super::*; diff --git a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuCompilationMessage.rs b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuCompilationMessage.rs index ae60573de9..ca7fec811d 100644 --- a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuCompilationMessage.rs +++ b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuCompilationMessage.rs @@ -18,7 +18,7 @@ // // If you want to improve the generated code, please submit a PR to the https://github.com/rustwasm/wasm-bindgen repository. // -// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.91` command. +// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.97` command. #![allow(unused_imports)] #![allow(clippy::all)] use super::*; @@ -47,7 +47,7 @@ extern "C" { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn message(this: &GpuCompilationMessage) -> String; + pub fn message(this: &GpuCompilationMessage) -> ::alloc::string::String; # [wasm_bindgen (structural , method , getter , js_class = "GPUCompilationMessage" , js_name = type)] #[doc = "Getter for the `type` field of this object."] diff --git a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuCompilationMessageType.rs b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuCompilationMessageType.rs index 3fcadd0f03..4db916ce83 100644 --- a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuCompilationMessageType.rs +++ b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuCompilationMessageType.rs @@ -18,7 +18,7 @@ // // If you want to improve the generated code, please submit a PR to the https://github.com/rustwasm/wasm-bindgen repository. // -// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.91` command. +// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.97` command. #![allow(unused_imports)] #![allow(clippy::all)] use wasm_bindgen::prelude::*; diff --git a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuComputePassDescriptor.rs b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuComputePassDescriptor.rs index d7f30e3e93..4658d3f694 100644 --- a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuComputePassDescriptor.rs +++ b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuComputePassDescriptor.rs @@ -18,7 +18,7 @@ // // If you want to improve the generated code, please submit a PR to the https://github.com/rustwasm/wasm-bindgen repository. // -// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.91` command. +// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.97` command. #![allow(unused_imports)] #![allow(clippy::all)] use super::*; @@ -35,20 +35,15 @@ extern "C" { #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub type GpuComputePassDescriptor; -} -impl GpuComputePassDescriptor { - #[doc = "Construct a new `GpuComputePassDescriptor`."] + #[doc = "Get the `label` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `GpuComputePassDescriptor`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn new() -> Self { - #[allow(unused_mut)] - let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); - ret - } + #[wasm_bindgen(method, getter = "label")] + pub fn get_label(this: &GpuComputePassDescriptor) -> Option<::alloc::string::String>; #[doc = "Change the `label` field of this object."] #[doc = ""] @@ -56,16 +51,19 @@ impl GpuComputePassDescriptor { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn label(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("label"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "label")] + pub fn set_label(this: &GpuComputePassDescriptor, val: &str); + + #[doc = "Get the `timestampWrites` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuComputePassDescriptor`, `GpuComputePassTimestampWrites`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "timestampWrites")] + pub fn get_timestamp_writes( + this: &GpuComputePassDescriptor, + ) -> Option; #[doc = "Change the `timestampWrites` field of this object."] #[doc = ""] @@ -73,18 +71,35 @@ impl GpuComputePassDescriptor { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "timestampWrites")] + pub fn set_timestamp_writes( + this: &GpuComputePassDescriptor, + val: &GpuComputePassTimestampWrites, + ); +} + +impl GpuComputePassDescriptor { + #[doc = "Construct a new `GpuComputePassDescriptor`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuComputePassDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new() -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret + } + + #[deprecated = "Use `set_label()` instead."] + pub fn label(&mut self, val: &str) -> &mut Self { + self.set_label(val); + self + } + + #[deprecated = "Use `set_timestamp_writes()` instead."] pub fn timestamp_writes(&mut self, val: &GpuComputePassTimestampWrites) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("timestampWrites"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_timestamp_writes(val); self } } diff --git a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuComputePassEncoder.rs b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuComputePassEncoder.rs index 2dd152edce..e84fce360c 100644 --- a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuComputePassEncoder.rs +++ b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuComputePassEncoder.rs @@ -18,7 +18,7 @@ // // If you want to improve the generated code, please submit a PR to the https://github.com/rustwasm/wasm-bindgen repository. // -// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.91` command. +// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.97` command. #![allow(unused_imports)] #![allow(clippy::all)] use super::*; @@ -47,7 +47,7 @@ extern "C" { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn label(this: &GpuComputePassEncoder) -> String; + pub fn label(this: &GpuComputePassEncoder) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "GPUComputePassEncoder" , js_name = label)] #[doc = "Setter for the `label` field of this object."] @@ -185,7 +185,7 @@ extern "C" { dynamic_offsets: &::wasm_bindgen::JsValue, ); - # [wasm_bindgen (method , structural , js_class = "GPUComputePassEncoder" , js_name = setBindGroup)] + # [wasm_bindgen (catch , method , structural , js_class = "GPUComputePassEncoder" , js_name = setBindGroup)] #[doc = "The `setBindGroup()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUComputePassEncoder/setBindGroup)"] @@ -194,16 +194,16 @@ extern "C" { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn set_bind_group_with_u32_array_and_u32_and_dynamic_offsets_data_length( + pub fn set_bind_group_with_u32_slice_and_u32_and_dynamic_offsets_data_length( this: &GpuComputePassEncoder, index: u32, bind_group: Option<&GpuBindGroup>, dynamic_offsets_data: &[u32], dynamic_offsets_data_start: u32, dynamic_offsets_data_length: u32, - ); + ) -> Result<(), JsValue>; - # [wasm_bindgen (method , structural , js_class = "GPUComputePassEncoder" , js_name = setBindGroup)] + # [wasm_bindgen (catch , method , structural , js_class = "GPUComputePassEncoder" , js_name = setBindGroup)] #[doc = "The `setBindGroup()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUComputePassEncoder/setBindGroup)"] @@ -212,14 +212,50 @@ extern "C" { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn set_bind_group_with_u32_array_and_f64_and_dynamic_offsets_data_length( + pub fn set_bind_group_with_u32_array_and_u32_and_dynamic_offsets_data_length( + this: &GpuComputePassEncoder, + index: u32, + bind_group: Option<&GpuBindGroup>, + dynamic_offsets_data: &::js_sys::Uint32Array, + dynamic_offsets_data_start: u32, + dynamic_offsets_data_length: u32, + ) -> Result<(), JsValue>; + + # [wasm_bindgen (catch , method , structural , js_class = "GPUComputePassEncoder" , js_name = setBindGroup)] + #[doc = "The `setBindGroup()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUComputePassEncoder/setBindGroup)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBindGroup`, `GpuComputePassEncoder`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn set_bind_group_with_u32_slice_and_f64_and_dynamic_offsets_data_length( this: &GpuComputePassEncoder, index: u32, bind_group: Option<&GpuBindGroup>, dynamic_offsets_data: &[u32], dynamic_offsets_data_start: f64, dynamic_offsets_data_length: u32, - ); + ) -> Result<(), JsValue>; + + # [wasm_bindgen (catch , method , structural , js_class = "GPUComputePassEncoder" , js_name = setBindGroup)] + #[doc = "The `setBindGroup()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUComputePassEncoder/setBindGroup)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBindGroup`, `GpuComputePassEncoder`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn set_bind_group_with_u32_array_and_f64_and_dynamic_offsets_data_length( + this: &GpuComputePassEncoder, + index: u32, + bind_group: Option<&GpuBindGroup>, + dynamic_offsets_data: &::js_sys::Uint32Array, + dynamic_offsets_data_start: f64, + dynamic_offsets_data_length: u32, + ) -> Result<(), JsValue>; # [wasm_bindgen (method , structural , js_class = "GPUComputePassEncoder" , js_name = insertDebugMarker)] #[doc = "The `insertDebugMarker()` method."] diff --git a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuComputePassTimestampWrites.rs b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuComputePassTimestampWrites.rs index 8b2afd73e3..8471fcc684 100644 --- a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuComputePassTimestampWrites.rs +++ b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuComputePassTimestampWrites.rs @@ -18,7 +18,7 @@ // // If you want to improve the generated code, please submit a PR to the https://github.com/rustwasm/wasm-bindgen repository. // -// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.91` command. +// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.97` command. #![allow(unused_imports)] #![allow(clippy::all)] use super::*; @@ -35,21 +35,15 @@ extern "C" { #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub type GpuComputePassTimestampWrites; -} -impl GpuComputePassTimestampWrites { - #[doc = "Construct a new `GpuComputePassTimestampWrites`."] + #[doc = "Get the `beginningOfPassWriteIndex` field of this object."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuComputePassTimestampWrites`, `GpuQuerySet`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuComputePassTimestampWrites`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn new(query_set: &GpuQuerySet) -> Self { - #[allow(unused_mut)] - let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); - ret.query_set(query_set); - ret - } + #[wasm_bindgen(method, getter = "beginningOfPassWriteIndex")] + pub fn get_beginning_of_pass_write_index(this: &GpuComputePassTimestampWrites) -> Option; #[doc = "Change the `beginningOfPassWriteIndex` field of this object."] #[doc = ""] @@ -57,20 +51,17 @@ impl GpuComputePassTimestampWrites { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn beginning_of_pass_write_index(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("beginningOfPassWriteIndex"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "beginningOfPassWriteIndex")] + pub fn set_beginning_of_pass_write_index(this: &GpuComputePassTimestampWrites, val: u32); + + #[doc = "Get the `endOfPassWriteIndex` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuComputePassTimestampWrites`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "endOfPassWriteIndex")] + pub fn get_end_of_pass_write_index(this: &GpuComputePassTimestampWrites) -> Option; #[doc = "Change the `endOfPassWriteIndex` field of this object."] #[doc = ""] @@ -78,20 +69,17 @@ impl GpuComputePassTimestampWrites { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn end_of_pass_write_index(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("endOfPassWriteIndex"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "endOfPassWriteIndex")] + pub fn set_end_of_pass_write_index(this: &GpuComputePassTimestampWrites, val: u32); + + #[doc = "Get the `querySet` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuComputePassTimestampWrites`, `GpuQuerySet`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "querySet")] + pub fn get_query_set(this: &GpuComputePassTimestampWrites) -> GpuQuerySet; #[doc = "Change the `querySet` field of this object."] #[doc = ""] @@ -99,18 +87,39 @@ impl GpuComputePassTimestampWrites { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "querySet")] + pub fn set_query_set(this: &GpuComputePassTimestampWrites, val: &GpuQuerySet); +} + +impl GpuComputePassTimestampWrites { + #[doc = "Construct a new `GpuComputePassTimestampWrites`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuComputePassTimestampWrites`, `GpuQuerySet`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new(query_set: &GpuQuerySet) -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret.set_query_set(query_set); + ret + } + + #[deprecated = "Use `set_beginning_of_pass_write_index()` instead."] + pub fn beginning_of_pass_write_index(&mut self, val: u32) -> &mut Self { + self.set_beginning_of_pass_write_index(val); + self + } + + #[deprecated = "Use `set_end_of_pass_write_index()` instead."] + pub fn end_of_pass_write_index(&mut self, val: u32) -> &mut Self { + self.set_end_of_pass_write_index(val); + self + } + + #[deprecated = "Use `set_query_set()` instead."] pub fn query_set(&mut self, val: &GpuQuerySet) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("querySet"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_query_set(val); self } } diff --git a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuComputePipeline.rs b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuComputePipeline.rs index 33a28f533b..b83697327c 100644 --- a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuComputePipeline.rs +++ b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuComputePipeline.rs @@ -18,7 +18,7 @@ // // If you want to improve the generated code, please submit a PR to the https://github.com/rustwasm/wasm-bindgen repository. // -// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.91` command. +// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.97` command. #![allow(unused_imports)] #![allow(clippy::all)] use super::*; @@ -47,7 +47,7 @@ extern "C" { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn label(this: &GpuComputePipeline) -> String; + pub fn label(this: &GpuComputePipeline) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "GPUComputePipeline" , js_name = label)] #[doc = "Setter for the `label` field of this object."] diff --git a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuComputePipelineDescriptor.rs b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuComputePipelineDescriptor.rs index 1184f400fc..b066e55ccd 100644 --- a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuComputePipelineDescriptor.rs +++ b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuComputePipelineDescriptor.rs @@ -18,7 +18,7 @@ // // If you want to improve the generated code, please submit a PR to the https://github.com/rustwasm/wasm-bindgen repository. // -// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.91` command. +// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.97` command. #![allow(unused_imports)] #![allow(clippy::all)] use super::*; @@ -35,22 +35,15 @@ extern "C" { #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub type GpuComputePipelineDescriptor; -} -impl GpuComputePipelineDescriptor { - #[doc = "Construct a new `GpuComputePipelineDescriptor`."] + #[doc = "Get the `label` field of this object."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuComputePipelineDescriptor`, `GpuProgrammableStage`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuComputePipelineDescriptor`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn new(layout: &::wasm_bindgen::JsValue, compute: &GpuProgrammableStage) -> Self { - #[allow(unused_mut)] - let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); - ret.layout(layout); - ret.compute(compute); - ret - } + #[wasm_bindgen(method, getter = "label")] + pub fn get_label(this: &GpuComputePipelineDescriptor) -> Option<::alloc::string::String>; #[doc = "Change the `label` field of this object."] #[doc = ""] @@ -58,16 +51,17 @@ impl GpuComputePipelineDescriptor { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn label(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("label"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "label")] + pub fn set_label(this: &GpuComputePipelineDescriptor, val: &str); + + #[doc = "Get the `layout` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuComputePipelineDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "layout")] + pub fn get_layout(this: &GpuComputePipelineDescriptor) -> ::wasm_bindgen::JsValue; #[doc = "Change the `layout` field of this object."] #[doc = ""] @@ -75,17 +69,17 @@ impl GpuComputePipelineDescriptor { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn layout(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("layout"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "layout")] + pub fn set_layout(this: &GpuComputePipelineDescriptor, val: &::wasm_bindgen::JsValue); + + #[doc = "Get the `compute` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuComputePipelineDescriptor`, `GpuProgrammableStage`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "compute")] + pub fn get_compute(this: &GpuComputePipelineDescriptor) -> GpuProgrammableStage; #[doc = "Change the `compute` field of this object."] #[doc = ""] @@ -93,18 +87,40 @@ impl GpuComputePipelineDescriptor { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "compute")] + pub fn set_compute(this: &GpuComputePipelineDescriptor, val: &GpuProgrammableStage); +} + +impl GpuComputePipelineDescriptor { + #[doc = "Construct a new `GpuComputePipelineDescriptor`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuComputePipelineDescriptor`, `GpuProgrammableStage`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new(layout: &::wasm_bindgen::JsValue, compute: &GpuProgrammableStage) -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret.set_layout(layout); + ret.set_compute(compute); + ret + } + + #[deprecated = "Use `set_label()` instead."] + pub fn label(&mut self, val: &str) -> &mut Self { + self.set_label(val); + self + } + + #[deprecated = "Use `set_layout()` instead."] + pub fn layout(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { + self.set_layout(val); + self + } + + #[deprecated = "Use `set_compute()` instead."] pub fn compute(&mut self, val: &GpuProgrammableStage) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("compute"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_compute(val); self } } diff --git a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuCopyExternalImageDestInfo.rs b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuCopyExternalImageDestInfo.rs new file mode 100644 index 0000000000..b7eab80a04 --- /dev/null +++ b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuCopyExternalImageDestInfo.rs @@ -0,0 +1,173 @@ +// DO NOT EDIT THIS FILE! +// +// This module part of a subset of web-sys that is used by wgpu's webgpu backend. +// +// These bindings are vendored into wgpu for the sole purpose of letting +// us pin the WebGPU backend to a specific version of the bindings, not +// to enable local changes. There are no provisions to preserve changes +// you make here the next time we re-vendor the bindings. +// +// The `web-sys` crate does not treat breaking changes to the WebGPU API +// as semver breaking changes, as WebGPU is "unstable". This means Cargo +// will not let us mix versions of `web-sys`, pinning WebGPU bindings to +// a specific version, while letting other bindings like WebGL get +// updated. Vendoring WebGPU was the workaround we chose. +// +// Vendoring also allows us to avoid building `web-sys` with +// `--cfg=web_sys_unstable_apis`, needed to get the WebGPU bindings. +// +// If you want to improve the generated code, please submit a PR to the https://github.com/rustwasm/wasm-bindgen repository. +// +// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.97` command. +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; + +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = GPUCopyExternalImageDestInfo)] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `GpuCopyExternalImageDestInfo` dictionary."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuCopyExternalImageDestInfo`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub type GpuCopyExternalImageDestInfo; + + #[doc = "Get the `aspect` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuCopyExternalImageDestInfo`, `GpuTextureAspect`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "aspect")] + pub fn get_aspect(this: &GpuCopyExternalImageDestInfo) -> Option; + + #[doc = "Change the `aspect` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuCopyExternalImageDestInfo`, `GpuTextureAspect`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "aspect")] + pub fn set_aspect(this: &GpuCopyExternalImageDestInfo, val: GpuTextureAspect); + + #[doc = "Get the `mipLevel` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuCopyExternalImageDestInfo`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "mipLevel")] + pub fn get_mip_level(this: &GpuCopyExternalImageDestInfo) -> Option; + + #[doc = "Change the `mipLevel` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuCopyExternalImageDestInfo`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "mipLevel")] + pub fn set_mip_level(this: &GpuCopyExternalImageDestInfo, val: u32); + + #[doc = "Get the `origin` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuCopyExternalImageDestInfo`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "origin")] + pub fn get_origin(this: &GpuCopyExternalImageDestInfo) -> ::wasm_bindgen::JsValue; + + #[doc = "Change the `origin` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuCopyExternalImageDestInfo`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "origin")] + pub fn set_origin(this: &GpuCopyExternalImageDestInfo, val: &::wasm_bindgen::JsValue); + + #[doc = "Get the `texture` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuCopyExternalImageDestInfo`, `GpuTexture`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "texture")] + pub fn get_texture(this: &GpuCopyExternalImageDestInfo) -> GpuTexture; + + #[doc = "Change the `texture` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuCopyExternalImageDestInfo`, `GpuTexture`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "texture")] + pub fn set_texture(this: &GpuCopyExternalImageDestInfo, val: &GpuTexture); + + #[doc = "Get the `premultipliedAlpha` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuCopyExternalImageDestInfo`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "premultipliedAlpha")] + pub fn get_premultiplied_alpha(this: &GpuCopyExternalImageDestInfo) -> Option; + + #[doc = "Change the `premultipliedAlpha` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuCopyExternalImageDestInfo`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "premultipliedAlpha")] + pub fn set_premultiplied_alpha(this: &GpuCopyExternalImageDestInfo, val: bool); +} + +impl GpuCopyExternalImageDestInfo { + #[doc = "Construct a new `GpuCopyExternalImageDestInfo`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuCopyExternalImageDestInfo`, `GpuTexture`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new(texture: &GpuTexture) -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret.set_texture(texture); + ret + } + + #[deprecated = "Use `set_aspect()` instead."] + pub fn aspect(&mut self, val: GpuTextureAspect) -> &mut Self { + self.set_aspect(val); + self + } + + #[deprecated = "Use `set_mip_level()` instead."] + pub fn mip_level(&mut self, val: u32) -> &mut Self { + self.set_mip_level(val); + self + } + + #[deprecated = "Use `set_origin()` instead."] + pub fn origin(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { + self.set_origin(val); + self + } + + #[deprecated = "Use `set_texture()` instead."] + pub fn texture(&mut self, val: &GpuTexture) -> &mut Self { + self.set_texture(val); + self + } + + #[deprecated = "Use `set_premultiplied_alpha()` instead."] + pub fn premultiplied_alpha(&mut self, val: bool) -> &mut Self { + self.set_premultiplied_alpha(val); + self + } +} diff --git a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuImageCopyTextureTagged.rs b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuCopyExternalImageSourceInfo.rs similarity index 57% rename from wgpu/src/backend/webgpu/webgpu_sys/gen_GpuImageCopyTextureTagged.rs rename to wgpu/src/backend/webgpu/webgpu_sys/gen_GpuCopyExternalImageSourceInfo.rs index 2928b74e54..87456d7dca 100644 --- a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuImageCopyTextureTagged.rs +++ b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuCopyExternalImageSourceInfo.rs @@ -18,7 +18,7 @@ // // If you want to improve the generated code, please submit a PR to the https://github.com/rustwasm/wasm-bindgen repository. // -// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.91` command. +// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.97` command. #![allow(unused_imports)] #![allow(clippy::all)] use super::*; @@ -26,127 +26,100 @@ use wasm_bindgen::prelude::*; #[wasm_bindgen] extern "C" { - # [wasm_bindgen (extends = :: js_sys :: Object , js_name = GPUImageCopyTextureTagged)] + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = GPUCopyExternalImageSourceInfo)] #[derive(Debug, Clone, PartialEq, Eq)] - #[doc = "The `GpuImageCopyTextureTagged` dictionary."] + #[doc = "The `GpuCopyExternalImageSourceInfo` dictionary."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuImageCopyTextureTagged`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuCopyExternalImageSourceInfo`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub type GpuImageCopyTextureTagged; -} + pub type GpuCopyExternalImageSourceInfo; -impl GpuImageCopyTextureTagged { - #[doc = "Construct a new `GpuImageCopyTextureTagged`."] + #[doc = "Get the `flipY` field of this object."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuImageCopyTextureTagged`, `GpuTexture`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuCopyExternalImageSourceInfo`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn new(texture: &GpuTexture) -> Self { - #[allow(unused_mut)] - let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); - ret.texture(texture); - ret - } + #[wasm_bindgen(method, getter = "flipY")] + pub fn get_flip_y(this: &GpuCopyExternalImageSourceInfo) -> Option; - #[doc = "Change the `aspect` field of this object."] + #[doc = "Change the `flipY` field of this object."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuImageCopyTextureTagged`, `GpuTextureAspect`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuCopyExternalImageSourceInfo`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn aspect(&mut self, val: GpuTextureAspect) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("aspect"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "flipY")] + pub fn set_flip_y(this: &GpuCopyExternalImageSourceInfo, val: bool); - #[doc = "Change the `mipLevel` field of this object."] + #[doc = "Get the `origin` field of this object."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuImageCopyTextureTagged`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuCopyExternalImageSourceInfo`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn mip_level(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("mipLevel"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, getter = "origin")] + pub fn get_origin(this: &GpuCopyExternalImageSourceInfo) -> ::wasm_bindgen::JsValue; #[doc = "Change the `origin` field of this object."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuImageCopyTextureTagged`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuCopyExternalImageSourceInfo`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn origin(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("origin"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "origin")] + pub fn set_origin(this: &GpuCopyExternalImageSourceInfo, val: &::wasm_bindgen::JsValue); - #[doc = "Change the `texture` field of this object."] + #[doc = "Get the `source` field of this object."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuImageCopyTextureTagged`, `GpuTexture`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuCopyExternalImageSourceInfo`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn texture(&mut self, val: &GpuTexture) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("texture"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, getter = "source")] + pub fn get_source(this: &GpuCopyExternalImageSourceInfo) -> ::js_sys::Object; + + #[doc = "Change the `source` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuCopyExternalImageSourceInfo`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "source")] + pub fn set_source(this: &GpuCopyExternalImageSourceInfo, val: &::js_sys::Object); +} - #[doc = "Change the `premultipliedAlpha` field of this object."] +impl GpuCopyExternalImageSourceInfo { + #[doc = "Construct a new `GpuCopyExternalImageSourceInfo`."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuImageCopyTextureTagged`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuCopyExternalImageSourceInfo`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn premultiplied_alpha(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("premultipliedAlpha"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + pub fn new(source: &::js_sys::Object) -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret.set_source(source); + ret + } + + #[deprecated = "Use `set_flip_y()` instead."] + pub fn flip_y(&mut self, val: bool) -> &mut Self { + self.set_flip_y(val); + self + } + + #[deprecated = "Use `set_origin()` instead."] + pub fn origin(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { + self.set_origin(val); + self + } + + #[deprecated = "Use `set_source()` instead."] + pub fn source(&mut self, val: &::js_sys::Object) -> &mut Self { + self.set_source(val); self } } diff --git a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuCullMode.rs b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuCullMode.rs index f9889938fe..4bb8c48b85 100644 --- a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuCullMode.rs +++ b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuCullMode.rs @@ -18,7 +18,7 @@ // // If you want to improve the generated code, please submit a PR to the https://github.com/rustwasm/wasm-bindgen repository. // -// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.91` command. +// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.97` command. #![allow(unused_imports)] #![allow(clippy::all)] use wasm_bindgen::prelude::*; diff --git a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuDepthStencilState.rs b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuDepthStencilState.rs index 098d3c4c26..577b39cf70 100644 --- a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuDepthStencilState.rs +++ b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuDepthStencilState.rs @@ -18,7 +18,7 @@ // // If you want to improve the generated code, please submit a PR to the https://github.com/rustwasm/wasm-bindgen repository. // -// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.91` command. +// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.97` command. #![allow(unused_imports)] #![allow(clippy::all)] use super::*; @@ -35,21 +35,15 @@ extern "C" { #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub type GpuDepthStencilState; -} -impl GpuDepthStencilState { - #[doc = "Construct a new `GpuDepthStencilState`."] + #[doc = "Get the `depthBias` field of this object."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuDepthStencilState`, `GpuTextureFormat`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuDepthStencilState`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn new(format: GpuTextureFormat) -> Self { - #[allow(unused_mut)] - let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); - ret.format(format); - ret - } + #[wasm_bindgen(method, getter = "depthBias")] + pub fn get_depth_bias(this: &GpuDepthStencilState) -> Option; #[doc = "Change the `depthBias` field of this object."] #[doc = ""] @@ -57,20 +51,17 @@ impl GpuDepthStencilState { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn depth_bias(&mut self, val: i32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("depthBias"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "depthBias")] + pub fn set_depth_bias(this: &GpuDepthStencilState, val: i32); + + #[doc = "Get the `depthBiasClamp` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuDepthStencilState`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "depthBiasClamp")] + pub fn get_depth_bias_clamp(this: &GpuDepthStencilState) -> Option; #[doc = "Change the `depthBiasClamp` field of this object."] #[doc = ""] @@ -78,20 +69,17 @@ impl GpuDepthStencilState { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn depth_bias_clamp(&mut self, val: f32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("depthBiasClamp"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "depthBiasClamp")] + pub fn set_depth_bias_clamp(this: &GpuDepthStencilState, val: f32); + + #[doc = "Get the `depthBiasSlopeScale` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuDepthStencilState`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "depthBiasSlopeScale")] + pub fn get_depth_bias_slope_scale(this: &GpuDepthStencilState) -> Option; #[doc = "Change the `depthBiasSlopeScale` field of this object."] #[doc = ""] @@ -99,20 +87,17 @@ impl GpuDepthStencilState { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn depth_bias_slope_scale(&mut self, val: f32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("depthBiasSlopeScale"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "depthBiasSlopeScale")] + pub fn set_depth_bias_slope_scale(this: &GpuDepthStencilState, val: f32); + + #[doc = "Get the `depthCompare` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuCompareFunction`, `GpuDepthStencilState`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "depthCompare")] + pub fn get_depth_compare(this: &GpuDepthStencilState) -> Option; #[doc = "Change the `depthCompare` field of this object."] #[doc = ""] @@ -120,20 +105,17 @@ impl GpuDepthStencilState { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn depth_compare(&mut self, val: GpuCompareFunction) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("depthCompare"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "depthCompare")] + pub fn set_depth_compare(this: &GpuDepthStencilState, val: GpuCompareFunction); + + #[doc = "Get the `depthWriteEnabled` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuDepthStencilState`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "depthWriteEnabled")] + pub fn get_depth_write_enabled(this: &GpuDepthStencilState) -> Option; #[doc = "Change the `depthWriteEnabled` field of this object."] #[doc = ""] @@ -141,20 +123,17 @@ impl GpuDepthStencilState { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn depth_write_enabled(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("depthWriteEnabled"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "depthWriteEnabled")] + pub fn set_depth_write_enabled(this: &GpuDepthStencilState, val: bool); + + #[doc = "Get the `format` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuDepthStencilState`, `GpuTextureFormat`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "format")] + pub fn get_format(this: &GpuDepthStencilState) -> GpuTextureFormat; #[doc = "Change the `format` field of this object."] #[doc = ""] @@ -162,17 +141,17 @@ impl GpuDepthStencilState { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn format(&mut self, val: GpuTextureFormat) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("format"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "format")] + pub fn set_format(this: &GpuDepthStencilState, val: GpuTextureFormat); + + #[doc = "Get the `stencilBack` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuDepthStencilState`, `GpuStencilFaceState`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "stencilBack")] + pub fn get_stencil_back(this: &GpuDepthStencilState) -> Option; #[doc = "Change the `stencilBack` field of this object."] #[doc = ""] @@ -180,20 +159,17 @@ impl GpuDepthStencilState { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn stencil_back(&mut self, val: &GpuStencilFaceState) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("stencilBack"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "stencilBack")] + pub fn set_stencil_back(this: &GpuDepthStencilState, val: &GpuStencilFaceState); + + #[doc = "Get the `stencilFront` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuDepthStencilState`, `GpuStencilFaceState`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "stencilFront")] + pub fn get_stencil_front(this: &GpuDepthStencilState) -> Option; #[doc = "Change the `stencilFront` field of this object."] #[doc = ""] @@ -201,20 +177,17 @@ impl GpuDepthStencilState { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn stencil_front(&mut self, val: &GpuStencilFaceState) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("stencilFront"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "stencilFront")] + pub fn set_stencil_front(this: &GpuDepthStencilState, val: &GpuStencilFaceState); + + #[doc = "Get the `stencilReadMask` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuDepthStencilState`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "stencilReadMask")] + pub fn get_stencil_read_mask(this: &GpuDepthStencilState) -> Option; #[doc = "Change the `stencilReadMask` field of this object."] #[doc = ""] @@ -222,20 +195,17 @@ impl GpuDepthStencilState { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn stencil_read_mask(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("stencilReadMask"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "stencilReadMask")] + pub fn set_stencil_read_mask(this: &GpuDepthStencilState, val: u32); + + #[doc = "Get the `stencilWriteMask` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuDepthStencilState`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "stencilWriteMask")] + pub fn get_stencil_write_mask(this: &GpuDepthStencilState) -> Option; #[doc = "Change the `stencilWriteMask` field of this object."] #[doc = ""] @@ -243,18 +213,81 @@ impl GpuDepthStencilState { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "stencilWriteMask")] + pub fn set_stencil_write_mask(this: &GpuDepthStencilState, val: u32); +} + +impl GpuDepthStencilState { + #[doc = "Construct a new `GpuDepthStencilState`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuDepthStencilState`, `GpuTextureFormat`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new(format: GpuTextureFormat) -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret.set_format(format); + ret + } + + #[deprecated = "Use `set_depth_bias()` instead."] + pub fn depth_bias(&mut self, val: i32) -> &mut Self { + self.set_depth_bias(val); + self + } + + #[deprecated = "Use `set_depth_bias_clamp()` instead."] + pub fn depth_bias_clamp(&mut self, val: f32) -> &mut Self { + self.set_depth_bias_clamp(val); + self + } + + #[deprecated = "Use `set_depth_bias_slope_scale()` instead."] + pub fn depth_bias_slope_scale(&mut self, val: f32) -> &mut Self { + self.set_depth_bias_slope_scale(val); + self + } + + #[deprecated = "Use `set_depth_compare()` instead."] + pub fn depth_compare(&mut self, val: GpuCompareFunction) -> &mut Self { + self.set_depth_compare(val); + self + } + + #[deprecated = "Use `set_depth_write_enabled()` instead."] + pub fn depth_write_enabled(&mut self, val: bool) -> &mut Self { + self.set_depth_write_enabled(val); + self + } + + #[deprecated = "Use `set_format()` instead."] + pub fn format(&mut self, val: GpuTextureFormat) -> &mut Self { + self.set_format(val); + self + } + + #[deprecated = "Use `set_stencil_back()` instead."] + pub fn stencil_back(&mut self, val: &GpuStencilFaceState) -> &mut Self { + self.set_stencil_back(val); + self + } + + #[deprecated = "Use `set_stencil_front()` instead."] + pub fn stencil_front(&mut self, val: &GpuStencilFaceState) -> &mut Self { + self.set_stencil_front(val); + self + } + + #[deprecated = "Use `set_stencil_read_mask()` instead."] + pub fn stencil_read_mask(&mut self, val: u32) -> &mut Self { + self.set_stencil_read_mask(val); + self + } + + #[deprecated = "Use `set_stencil_write_mask()` instead."] pub fn stencil_write_mask(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("stencilWriteMask"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_stencil_write_mask(val); self } } diff --git a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuDevice.rs b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuDevice.rs index 57f3bda9c1..9e283c4ab1 100644 --- a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuDevice.rs +++ b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuDevice.rs @@ -18,7 +18,7 @@ // // If you want to improve the generated code, please submit a PR to the https://github.com/rustwasm/wasm-bindgen repository. // -// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.91` command. +// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.97` command. #![allow(unused_imports)] #![allow(clippy::all)] use super::*; @@ -60,6 +60,17 @@ extern "C" { #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn limits(this: &GpuDevice) -> GpuSupportedLimits; + # [wasm_bindgen (structural , method , getter , js_class = "GPUDevice" , js_name = adapterInfo)] + #[doc = "Getter for the `adapterInfo` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUDevice/adapterInfo)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuAdapterInfo`, `GpuDevice`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn adapter_info(this: &GpuDevice) -> GpuAdapterInfo; + # [wasm_bindgen (structural , method , getter , js_class = "GPUDevice" , js_name = queue)] #[doc = "Getter for the `queue` field of this object."] #[doc = ""] @@ -113,7 +124,7 @@ extern "C" { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn label(this: &GpuDevice) -> String; + pub fn label(this: &GpuDevice) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "GPUDevice" , js_name = label)] #[doc = "Setter for the `label` field of this object."] @@ -138,7 +149,7 @@ extern "C" { pub fn create_bind_group(this: &GpuDevice, descriptor: &GpuBindGroupDescriptor) -> GpuBindGroup; - # [wasm_bindgen (method , structural , js_class = "GPUDevice" , js_name = createBindGroupLayout)] + # [wasm_bindgen (catch , method , structural , js_class = "GPUDevice" , js_name = createBindGroupLayout)] #[doc = "The `createBindGroupLayout()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUDevice/createBindGroupLayout)"] @@ -150,9 +161,9 @@ extern "C" { pub fn create_bind_group_layout( this: &GpuDevice, descriptor: &GpuBindGroupLayoutDescriptor, - ) -> GpuBindGroupLayout; + ) -> Result; - # [wasm_bindgen (method , structural , js_class = "GPUDevice" , js_name = createBuffer)] + # [wasm_bindgen (catch , method , structural , js_class = "GPUDevice" , js_name = createBuffer)] #[doc = "The `createBuffer()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUDevice/createBuffer)"] @@ -161,7 +172,10 @@ extern "C" { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn create_buffer(this: &GpuDevice, descriptor: &GpuBufferDescriptor) -> GpuBuffer; + pub fn create_buffer( + this: &GpuDevice, + descriptor: &GpuBufferDescriptor, + ) -> Result; # [wasm_bindgen (method , structural , js_class = "GPUDevice" , js_name = createCommandEncoder)] #[doc = "The `createCommandEncoder()` method."] @@ -230,7 +244,7 @@ extern "C" { descriptor: &GpuPipelineLayoutDescriptor, ) -> GpuPipelineLayout; - # [wasm_bindgen (method , structural , js_class = "GPUDevice" , js_name = createQuerySet)] + # [wasm_bindgen (catch , method , structural , js_class = "GPUDevice" , js_name = createQuerySet)] #[doc = "The `createQuerySet()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUDevice/createQuerySet)"] @@ -239,9 +253,12 @@ extern "C" { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn create_query_set(this: &GpuDevice, descriptor: &GpuQuerySetDescriptor) -> GpuQuerySet; + pub fn create_query_set( + this: &GpuDevice, + descriptor: &GpuQuerySetDescriptor, + ) -> Result; - # [wasm_bindgen (method , structural , js_class = "GPUDevice" , js_name = createRenderBundleEncoder)] + # [wasm_bindgen (catch , method , structural , js_class = "GPUDevice" , js_name = createRenderBundleEncoder)] #[doc = "The `createRenderBundleEncoder()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUDevice/createRenderBundleEncoder)"] @@ -253,9 +270,9 @@ extern "C" { pub fn create_render_bundle_encoder( this: &GpuDevice, descriptor: &GpuRenderBundleEncoderDescriptor, - ) -> GpuRenderBundleEncoder; + ) -> Result; - # [wasm_bindgen (method , structural , js_class = "GPUDevice" , js_name = createRenderPipeline)] + # [wasm_bindgen (catch , method , structural , js_class = "GPUDevice" , js_name = createRenderPipeline)] #[doc = "The `createRenderPipeline()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUDevice/createRenderPipeline)"] @@ -267,7 +284,7 @@ extern "C" { pub fn create_render_pipeline( this: &GpuDevice, descriptor: &GpuRenderPipelineDescriptor, - ) -> GpuRenderPipeline; + ) -> Result; # [wasm_bindgen (method , structural , js_class = "GPUDevice" , js_name = createRenderPipelineAsync)] #[doc = "The `createRenderPipelineAsync()` method."] @@ -322,7 +339,7 @@ extern "C" { descriptor: &GpuShaderModuleDescriptor, ) -> GpuShaderModule; - # [wasm_bindgen (method , structural , js_class = "GPUDevice" , js_name = createTexture)] + # [wasm_bindgen (catch , method , structural , js_class = "GPUDevice" , js_name = createTexture)] #[doc = "The `createTexture()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUDevice/createTexture)"] @@ -331,7 +348,10 @@ extern "C" { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn create_texture(this: &GpuDevice, descriptor: &GpuTextureDescriptor) -> GpuTexture; + pub fn create_texture( + this: &GpuDevice, + descriptor: &GpuTextureDescriptor, + ) -> Result; # [wasm_bindgen (method , structural , js_class = "GPUDevice" , js_name = destroy)] #[doc = "The `destroy()` method."] @@ -344,7 +364,7 @@ extern "C" { #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn destroy(this: &GpuDevice); - # [wasm_bindgen (method , structural , js_class = "GPUDevice" , js_name = importExternalTexture)] + # [wasm_bindgen (catch , method , structural , js_class = "GPUDevice" , js_name = importExternalTexture)] #[doc = "The `importExternalTexture()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUDevice/importExternalTexture)"] @@ -356,7 +376,7 @@ extern "C" { pub fn import_external_texture( this: &GpuDevice, descriptor: &GpuExternalTextureDescriptor, - ) -> GpuExternalTexture; + ) -> Result; # [wasm_bindgen (method , structural , js_class = "GPUDevice" , js_name = popErrorScope)] #[doc = "The `popErrorScope()` method."] diff --git a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuDeviceDescriptor.rs b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuDeviceDescriptor.rs index f712d4c514..6c4641ffc3 100644 --- a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuDeviceDescriptor.rs +++ b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuDeviceDescriptor.rs @@ -18,7 +18,7 @@ // // If you want to improve the generated code, please submit a PR to the https://github.com/rustwasm/wasm-bindgen repository. // -// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.91` command. +// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.97` command. #![allow(unused_imports)] #![allow(clippy::all)] use super::*; @@ -35,20 +35,15 @@ extern "C" { #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub type GpuDeviceDescriptor; -} -impl GpuDeviceDescriptor { - #[doc = "Construct a new `GpuDeviceDescriptor`."] + #[doc = "Get the `label` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `GpuDeviceDescriptor`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn new() -> Self { - #[allow(unused_mut)] - let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); - ret - } + #[wasm_bindgen(method, getter = "label")] + pub fn get_label(this: &GpuDeviceDescriptor) -> Option<::alloc::string::String>; #[doc = "Change the `label` field of this object."] #[doc = ""] @@ -56,16 +51,17 @@ impl GpuDeviceDescriptor { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn label(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("label"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "label")] + pub fn set_label(this: &GpuDeviceDescriptor, val: &str); + + #[doc = "Get the `defaultQueue` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuDeviceDescriptor`, `GpuQueueDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "defaultQueue")] + pub fn get_default_queue(this: &GpuDeviceDescriptor) -> Option; #[doc = "Change the `defaultQueue` field of this object."] #[doc = ""] @@ -73,20 +69,17 @@ impl GpuDeviceDescriptor { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn default_queue(&mut self, val: &GpuQueueDescriptor) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("defaultQueue"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "defaultQueue")] + pub fn set_default_queue(this: &GpuDeviceDescriptor, val: &GpuQueueDescriptor); + + #[doc = "Get the `requiredFeatures` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuDeviceDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "requiredFeatures")] + pub fn get_required_features(this: &GpuDeviceDescriptor) -> Option<::js_sys::Array>; #[doc = "Change the `requiredFeatures` field of this object."] #[doc = ""] @@ -94,18 +87,62 @@ impl GpuDeviceDescriptor { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "requiredFeatures")] + pub fn set_required_features(this: &GpuDeviceDescriptor, val: &::wasm_bindgen::JsValue); + + #[doc = "Get the `requiredLimits` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuDeviceDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "requiredLimits")] + pub fn get_required_limits(this: &GpuDeviceDescriptor) -> Option<::js_sys::Object>; + + #[doc = "Change the `requiredLimits` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuDeviceDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "requiredLimits")] + pub fn set_required_limits(this: &GpuDeviceDescriptor, val: &::js_sys::Object); +} + +impl GpuDeviceDescriptor { + #[doc = "Construct a new `GpuDeviceDescriptor`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuDeviceDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new() -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret + } + + #[deprecated = "Use `set_label()` instead."] + pub fn label(&mut self, val: &str) -> &mut Self { + self.set_label(val); + self + } + + #[deprecated = "Use `set_default_queue()` instead."] + pub fn default_queue(&mut self, val: &GpuQueueDescriptor) -> &mut Self { + self.set_default_queue(val); + self + } + + #[deprecated = "Use `set_required_features()` instead."] pub fn required_features(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("requiredFeatures"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_required_features(val); + self + } + + #[deprecated = "Use `set_required_limits()` instead."] + pub fn required_limits(&mut self, val: &::js_sys::Object) -> &mut Self { + self.set_required_limits(val); self } } diff --git a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuDeviceLostInfo.rs b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuDeviceLostInfo.rs index d2d670a40b..b85fd45b06 100644 --- a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuDeviceLostInfo.rs +++ b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuDeviceLostInfo.rs @@ -18,7 +18,7 @@ // // If you want to improve the generated code, please submit a PR to the https://github.com/rustwasm/wasm-bindgen repository. // -// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.91` command. +// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.97` command. #![allow(unused_imports)] #![allow(clippy::all)] use super::*; @@ -58,5 +58,5 @@ extern "C" { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn message(this: &GpuDeviceLostInfo) -> String; + pub fn message(this: &GpuDeviceLostInfo) -> ::alloc::string::String; } diff --git a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuDeviceLostReason.rs b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuDeviceLostReason.rs index bbe71dd5e6..748016e29c 100644 --- a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuDeviceLostReason.rs +++ b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuDeviceLostReason.rs @@ -18,7 +18,7 @@ // // If you want to improve the generated code, please submit a PR to the https://github.com/rustwasm/wasm-bindgen repository. // -// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.91` command. +// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.97` command. #![allow(unused_imports)] #![allow(clippy::all)] use wasm_bindgen::prelude::*; diff --git a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuError.rs b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuError.rs index 26b9b347df..3517ece149 100644 --- a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuError.rs +++ b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuError.rs @@ -18,7 +18,7 @@ // // If you want to improve the generated code, please submit a PR to the https://github.com/rustwasm/wasm-bindgen repository. // -// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.91` command. +// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.97` command. #![allow(unused_imports)] #![allow(clippy::all)] use super::*; @@ -47,5 +47,5 @@ extern "C" { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn message(this: &GpuError) -> String; + pub fn message(this: &GpuError) -> ::alloc::string::String; } diff --git a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuErrorFilter.rs b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuErrorFilter.rs index 27ef19258f..15b38a4137 100644 --- a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuErrorFilter.rs +++ b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuErrorFilter.rs @@ -18,7 +18,7 @@ // // If you want to improve the generated code, please submit a PR to the https://github.com/rustwasm/wasm-bindgen repository. // -// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.91` command. +// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.97` command. #![allow(unused_imports)] #![allow(clippy::all)] use wasm_bindgen::prelude::*; diff --git a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuExtent3dDict.rs b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuExtent3dDict.rs index 910e2030bb..e06b12f5b3 100644 --- a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuExtent3dDict.rs +++ b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuExtent3dDict.rs @@ -18,7 +18,7 @@ // // If you want to improve the generated code, please submit a PR to the https://github.com/rustwasm/wasm-bindgen repository. // -// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.91` command. +// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.97` command. #![allow(unused_imports)] #![allow(clippy::all)] use super::*; @@ -35,21 +35,15 @@ extern "C" { #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub type GpuExtent3dDict; -} -impl GpuExtent3dDict { - #[doc = "Construct a new `GpuExtent3dDict`."] + #[doc = "Get the `depthOrArrayLayers` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `GpuExtent3dDict`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn new(width: u32) -> Self { - #[allow(unused_mut)] - let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); - ret.width(width); - ret - } + #[wasm_bindgen(method, getter = "depthOrArrayLayers")] + pub fn get_depth_or_array_layers(this: &GpuExtent3dDict) -> Option; #[doc = "Change the `depthOrArrayLayers` field of this object."] #[doc = ""] @@ -57,20 +51,17 @@ impl GpuExtent3dDict { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn depth_or_array_layers(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("depthOrArrayLayers"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "depthOrArrayLayers")] + pub fn set_depth_or_array_layers(this: &GpuExtent3dDict, val: u32); + + #[doc = "Get the `height` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuExtent3dDict`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "height")] + pub fn get_height(this: &GpuExtent3dDict) -> Option; #[doc = "Change the `height` field of this object."] #[doc = ""] @@ -78,17 +69,17 @@ impl GpuExtent3dDict { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn height(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("height"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "height")] + pub fn set_height(this: &GpuExtent3dDict, val: u32); + + #[doc = "Get the `width` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuExtent3dDict`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "width")] + pub fn get_width(this: &GpuExtent3dDict) -> u32; #[doc = "Change the `width` field of this object."] #[doc = ""] @@ -96,14 +87,39 @@ impl GpuExtent3dDict { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "width")] + pub fn set_width(this: &GpuExtent3dDict, val: u32); +} + +impl GpuExtent3dDict { + #[doc = "Construct a new `GpuExtent3dDict`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuExtent3dDict`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new(width: u32) -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret.set_width(width); + ret + } + + #[deprecated = "Use `set_depth_or_array_layers()` instead."] + pub fn depth_or_array_layers(&mut self, val: u32) -> &mut Self { + self.set_depth_or_array_layers(val); + self + } + + #[deprecated = "Use `set_height()` instead."] + pub fn height(&mut self, val: u32) -> &mut Self { + self.set_height(val); + self + } + + #[deprecated = "Use `set_width()` instead."] pub fn width(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("width"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_width(val); self } } diff --git a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuExternalTexture.rs b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuExternalTexture.rs index a620e80d1b..e4effa78c1 100644 --- a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuExternalTexture.rs +++ b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuExternalTexture.rs @@ -18,7 +18,7 @@ // // If you want to improve the generated code, please submit a PR to the https://github.com/rustwasm/wasm-bindgen repository. // -// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.91` command. +// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.97` command. #![allow(unused_imports)] #![allow(clippy::all)] use super::*; @@ -47,7 +47,7 @@ extern "C" { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn label(this: &GpuExternalTexture) -> String; + pub fn label(this: &GpuExternalTexture) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "GPUExternalTexture" , js_name = label)] #[doc = "Setter for the `label` field of this object."] diff --git a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuExternalTextureBindingLayout.rs b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuExternalTextureBindingLayout.rs index 68e13a5cf0..4597f27866 100644 --- a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuExternalTextureBindingLayout.rs +++ b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuExternalTextureBindingLayout.rs @@ -18,7 +18,7 @@ // // If you want to improve the generated code, please submit a PR to the https://github.com/rustwasm/wasm-bindgen repository. // -// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.91` command. +// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.97` command. #![allow(unused_imports)] #![allow(clippy::all)] use super::*; diff --git a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuExternalTextureDescriptor.rs b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuExternalTextureDescriptor.rs index 086361305d..2c950be65d 100644 --- a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuExternalTextureDescriptor.rs +++ b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuExternalTextureDescriptor.rs @@ -18,7 +18,7 @@ // // If you want to improve the generated code, please submit a PR to the https://github.com/rustwasm/wasm-bindgen repository. // -// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.91` command. +// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.97` command. #![allow(unused_imports)] #![allow(clippy::all)] use super::*; @@ -35,21 +35,15 @@ extern "C" { #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub type GpuExternalTextureDescriptor; -} -impl GpuExternalTextureDescriptor { - #[doc = "Construct a new `GpuExternalTextureDescriptor`."] + #[doc = "Get the `label` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `GpuExternalTextureDescriptor`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn new(source: &::js_sys::Object) -> Self { - #[allow(unused_mut)] - let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); - ret.source(source); - ret - } + #[wasm_bindgen(method, getter = "label")] + pub fn get_label(this: &GpuExternalTextureDescriptor) -> Option<::alloc::string::String>; #[doc = "Change the `label` field of this object."] #[doc = ""] @@ -57,16 +51,17 @@ impl GpuExternalTextureDescriptor { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn label(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("label"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "label")] + pub fn set_label(this: &GpuExternalTextureDescriptor, val: &str); + + #[doc = "Get the `source` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuExternalTextureDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "source")] + pub fn get_source(this: &GpuExternalTextureDescriptor) -> ::js_sys::Object; #[doc = "Change the `source` field of this object."] #[doc = ""] @@ -74,15 +69,33 @@ impl GpuExternalTextureDescriptor { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "source")] + pub fn set_source(this: &GpuExternalTextureDescriptor, val: &::js_sys::Object); +} + +impl GpuExternalTextureDescriptor { + #[doc = "Construct a new `GpuExternalTextureDescriptor`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuExternalTextureDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new(source: &::js_sys::Object) -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret.set_source(source); + ret + } + + #[deprecated = "Use `set_label()` instead."] + pub fn label(&mut self, val: &str) -> &mut Self { + self.set_label(val); + self + } + + #[deprecated = "Use `set_source()` instead."] pub fn source(&mut self, val: &::js_sys::Object) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("source"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_source(val); self } } diff --git a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuFeatureName.rs b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuFeatureName.rs index 353bfcef21..7fa2799d41 100644 --- a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuFeatureName.rs +++ b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuFeatureName.rs @@ -18,7 +18,7 @@ // // If you want to improve the generated code, please submit a PR to the https://github.com/rustwasm/wasm-bindgen repository. // -// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.91` command. +// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.97` command. #![allow(unused_imports)] #![allow(clippy::all)] use wasm_bindgen::prelude::*; @@ -38,10 +38,14 @@ pub enum GpuFeatureName { TextureCompressionBcSliced3d = "texture-compression-bc-sliced-3d", TextureCompressionEtc2 = "texture-compression-etc2", TextureCompressionAstc = "texture-compression-astc", + TextureCompressionAstcSliced3d = "texture-compression-astc-sliced-3d", TimestampQuery = "timestamp-query", IndirectFirstInstance = "indirect-first-instance", ShaderF16 = "shader-f16", Rg11b10ufloatRenderable = "rg11b10ufloat-renderable", Bgra8unormStorage = "bgra8unorm-storage", Float32Filterable = "float32-filterable", + Float32Blendable = "float32-blendable", + ClipDistances = "clip-distances", + DualSourceBlending = "dual-source-blending", } diff --git a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuFilterMode.rs b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuFilterMode.rs index a2b3122856..b7cb82cd44 100644 --- a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuFilterMode.rs +++ b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuFilterMode.rs @@ -18,7 +18,7 @@ // // If you want to improve the generated code, please submit a PR to the https://github.com/rustwasm/wasm-bindgen repository. // -// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.91` command. +// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.97` command. #![allow(unused_imports)] #![allow(clippy::all)] use wasm_bindgen::prelude::*; diff --git a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuFragmentState.rs b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuFragmentState.rs index 1b42597649..9490fc3dc5 100644 --- a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuFragmentState.rs +++ b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuFragmentState.rs @@ -18,7 +18,7 @@ // // If you want to improve the generated code, please submit a PR to the https://github.com/rustwasm/wasm-bindgen repository. // -// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.91` command. +// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.97` command. #![allow(unused_imports)] #![allow(clippy::all)] use super::*; @@ -35,22 +35,33 @@ extern "C" { #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub type GpuFragmentState; -} -impl GpuFragmentState { - #[doc = "Construct a new `GpuFragmentState`."] + #[doc = "Get the `constants` field of this object."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuFragmentState`, `GpuShaderModule`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuFragmentState`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn new(module: &GpuShaderModule, targets: &::wasm_bindgen::JsValue) -> Self { - #[allow(unused_mut)] - let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); - ret.module(module); - ret.targets(targets); - ret - } + #[wasm_bindgen(method, getter = "constants")] + pub fn get_constants(this: &GpuFragmentState) -> Option<::js_sys::Object>; + + #[doc = "Change the `constants` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuFragmentState`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "constants")] + pub fn set_constants(this: &GpuFragmentState, val: &::js_sys::Object); + + #[doc = "Get the `entryPoint` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuFragmentState`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "entryPoint")] + pub fn get_entry_point(this: &GpuFragmentState) -> Option<::alloc::string::String>; #[doc = "Change the `entryPoint` field of this object."] #[doc = ""] @@ -58,20 +69,17 @@ impl GpuFragmentState { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn entry_point(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("entryPoint"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "entryPoint")] + pub fn set_entry_point(this: &GpuFragmentState, val: &str); + + #[doc = "Get the `module` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuFragmentState`, `GpuShaderModule`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "module")] + pub fn get_module(this: &GpuFragmentState) -> GpuShaderModule; #[doc = "Change the `module` field of this object."] #[doc = ""] @@ -79,17 +87,17 @@ impl GpuFragmentState { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn module(&mut self, val: &GpuShaderModule) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("module"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "module")] + pub fn set_module(this: &GpuFragmentState, val: &GpuShaderModule); + + #[doc = "Get the `targets` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuFragmentState`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "targets")] + pub fn get_targets(this: &GpuFragmentState) -> ::js_sys::Array; #[doc = "Change the `targets` field of this object."] #[doc = ""] @@ -97,18 +105,46 @@ impl GpuFragmentState { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "targets")] + pub fn set_targets(this: &GpuFragmentState, val: &::wasm_bindgen::JsValue); +} + +impl GpuFragmentState { + #[doc = "Construct a new `GpuFragmentState`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuFragmentState`, `GpuShaderModule`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new(module: &GpuShaderModule, targets: &::wasm_bindgen::JsValue) -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret.set_module(module); + ret.set_targets(targets); + ret + } + + #[deprecated = "Use `set_constants()` instead."] + pub fn constants(&mut self, val: &::js_sys::Object) -> &mut Self { + self.set_constants(val); + self + } + + #[deprecated = "Use `set_entry_point()` instead."] + pub fn entry_point(&mut self, val: &str) -> &mut Self { + self.set_entry_point(val); + self + } + + #[deprecated = "Use `set_module()` instead."] + pub fn module(&mut self, val: &GpuShaderModule) -> &mut Self { + self.set_module(val); + self + } + + #[deprecated = "Use `set_targets()` instead."] pub fn targets(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("targets"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_targets(val); self } } diff --git a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuFrontFace.rs b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuFrontFace.rs index 3d206ace43..07a4872244 100644 --- a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuFrontFace.rs +++ b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuFrontFace.rs @@ -18,7 +18,7 @@ // // If you want to improve the generated code, please submit a PR to the https://github.com/rustwasm/wasm-bindgen repository. // -// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.91` command. +// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.97` command. #![allow(unused_imports)] #![allow(clippy::all)] use wasm_bindgen::prelude::*; diff --git a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuIndexFormat.rs b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuIndexFormat.rs index 03ca2d116a..c70d34a370 100644 --- a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuIndexFormat.rs +++ b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuIndexFormat.rs @@ -18,7 +18,7 @@ // // If you want to improve the generated code, please submit a PR to the https://github.com/rustwasm/wasm-bindgen repository. // -// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.91` command. +// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.97` command. #![allow(unused_imports)] #![allow(clippy::all)] use wasm_bindgen::prelude::*; diff --git a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuLoadOp.rs b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuLoadOp.rs index 40230f0038..7963f5aff9 100644 --- a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuLoadOp.rs +++ b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuLoadOp.rs @@ -18,7 +18,7 @@ // // If you want to improve the generated code, please submit a PR to the https://github.com/rustwasm/wasm-bindgen repository. // -// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.91` command. +// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.97` command. #![allow(unused_imports)] #![allow(clippy::all)] use wasm_bindgen::prelude::*; diff --git a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuMipmapFilterMode.rs b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuMipmapFilterMode.rs index ecf0eae46a..531607e88a 100644 --- a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuMipmapFilterMode.rs +++ b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuMipmapFilterMode.rs @@ -18,7 +18,7 @@ // // If you want to improve the generated code, please submit a PR to the https://github.com/rustwasm/wasm-bindgen repository. // -// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.91` command. +// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.97` command. #![allow(unused_imports)] #![allow(clippy::all)] use wasm_bindgen::prelude::*; diff --git a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuMultisampleState.rs b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuMultisampleState.rs index 1b5ecaedd4..f517ae3a6a 100644 --- a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuMultisampleState.rs +++ b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuMultisampleState.rs @@ -18,7 +18,7 @@ // // If you want to improve the generated code, please submit a PR to the https://github.com/rustwasm/wasm-bindgen repository. // -// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.91` command. +// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.97` command. #![allow(unused_imports)] #![allow(clippy::all)] use super::*; @@ -35,20 +35,15 @@ extern "C" { #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub type GpuMultisampleState; -} -impl GpuMultisampleState { - #[doc = "Construct a new `GpuMultisampleState`."] + #[doc = "Get the `alphaToCoverageEnabled` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `GpuMultisampleState`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn new() -> Self { - #[allow(unused_mut)] - let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); - ret - } + #[wasm_bindgen(method, getter = "alphaToCoverageEnabled")] + pub fn get_alpha_to_coverage_enabled(this: &GpuMultisampleState) -> Option; #[doc = "Change the `alphaToCoverageEnabled` field of this object."] #[doc = ""] @@ -56,20 +51,17 @@ impl GpuMultisampleState { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn alpha_to_coverage_enabled(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("alphaToCoverageEnabled"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "alphaToCoverageEnabled")] + pub fn set_alpha_to_coverage_enabled(this: &GpuMultisampleState, val: bool); + + #[doc = "Get the `count` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuMultisampleState`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "count")] + pub fn get_count(this: &GpuMultisampleState) -> Option; #[doc = "Change the `count` field of this object."] #[doc = ""] @@ -77,16 +69,17 @@ impl GpuMultisampleState { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn count(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("count"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "count")] + pub fn set_count(this: &GpuMultisampleState, val: u32); + + #[doc = "Get the `mask` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuMultisampleState`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "mask")] + pub fn get_mask(this: &GpuMultisampleState) -> Option; #[doc = "Change the `mask` field of this object."] #[doc = ""] @@ -94,14 +87,38 @@ impl GpuMultisampleState { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "mask")] + pub fn set_mask(this: &GpuMultisampleState, val: u32); +} + +impl GpuMultisampleState { + #[doc = "Construct a new `GpuMultisampleState`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuMultisampleState`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new() -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret + } + + #[deprecated = "Use `set_alpha_to_coverage_enabled()` instead."] + pub fn alpha_to_coverage_enabled(&mut self, val: bool) -> &mut Self { + self.set_alpha_to_coverage_enabled(val); + self + } + + #[deprecated = "Use `set_count()` instead."] + pub fn count(&mut self, val: u32) -> &mut Self { + self.set_count(val); + self + } + + #[deprecated = "Use `set_mask()` instead."] pub fn mask(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("mask"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_mask(val); self } } diff --git a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuObjectDescriptorBase.rs b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuObjectDescriptorBase.rs index ecfdfae7b5..7666dc76bb 100644 --- a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuObjectDescriptorBase.rs +++ b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuObjectDescriptorBase.rs @@ -18,7 +18,7 @@ // // If you want to improve the generated code, please submit a PR to the https://github.com/rustwasm/wasm-bindgen repository. // -// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.91` command. +// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.97` command. #![allow(unused_imports)] #![allow(clippy::all)] use super::*; @@ -35,6 +35,24 @@ extern "C" { #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub type GpuObjectDescriptorBase; + + #[doc = "Get the `label` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuObjectDescriptorBase`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "label")] + pub fn get_label(this: &GpuObjectDescriptorBase) -> Option<::alloc::string::String>; + + #[doc = "Change the `label` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuObjectDescriptorBase`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "label")] + pub fn set_label(this: &GpuObjectDescriptorBase, val: &str); } impl GpuObjectDescriptorBase { @@ -50,20 +68,9 @@ impl GpuObjectDescriptorBase { ret } - #[doc = "Change the `label` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuObjectDescriptorBase`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[deprecated = "Use `set_label()` instead."] pub fn label(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("label"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_label(val); self } } diff --git a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuOrigin2dDict.rs b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuOrigin2dDict.rs index 9b02f7d4b7..a055e97198 100644 --- a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuOrigin2dDict.rs +++ b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuOrigin2dDict.rs @@ -18,7 +18,7 @@ // // If you want to improve the generated code, please submit a PR to the https://github.com/rustwasm/wasm-bindgen repository. // -// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.91` command. +// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.97` command. #![allow(unused_imports)] #![allow(clippy::all)] use super::*; @@ -35,20 +35,15 @@ extern "C" { #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub type GpuOrigin2dDict; -} -impl GpuOrigin2dDict { - #[doc = "Construct a new `GpuOrigin2dDict`."] + #[doc = "Get the `x` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `GpuOrigin2dDict`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn new() -> Self { - #[allow(unused_mut)] - let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); - ret - } + #[wasm_bindgen(method, getter = "x")] + pub fn get_x(this: &GpuOrigin2dDict) -> Option; #[doc = "Change the `x` field of this object."] #[doc = ""] @@ -56,16 +51,17 @@ impl GpuOrigin2dDict { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn x(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("x"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "x")] + pub fn set_x(this: &GpuOrigin2dDict, val: u32); + + #[doc = "Get the `y` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuOrigin2dDict`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "y")] + pub fn get_y(this: &GpuOrigin2dDict) -> Option; #[doc = "Change the `y` field of this object."] #[doc = ""] @@ -73,14 +69,32 @@ impl GpuOrigin2dDict { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "y")] + pub fn set_y(this: &GpuOrigin2dDict, val: u32); +} + +impl GpuOrigin2dDict { + #[doc = "Construct a new `GpuOrigin2dDict`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuOrigin2dDict`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new() -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret + } + + #[deprecated = "Use `set_x()` instead."] + pub fn x(&mut self, val: u32) -> &mut Self { + self.set_x(val); + self + } + + #[deprecated = "Use `set_y()` instead."] pub fn y(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("y"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_y(val); self } } diff --git a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuOrigin3dDict.rs b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuOrigin3dDict.rs index 697137c710..a3356ed2fe 100644 --- a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuOrigin3dDict.rs +++ b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuOrigin3dDict.rs @@ -18,7 +18,7 @@ // // If you want to improve the generated code, please submit a PR to the https://github.com/rustwasm/wasm-bindgen repository. // -// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.91` command. +// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.97` command. #![allow(unused_imports)] #![allow(clippy::all)] use super::*; @@ -35,20 +35,15 @@ extern "C" { #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub type GpuOrigin3dDict; -} -impl GpuOrigin3dDict { - #[doc = "Construct a new `GpuOrigin3dDict`."] + #[doc = "Get the `x` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `GpuOrigin3dDict`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn new() -> Self { - #[allow(unused_mut)] - let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); - ret - } + #[wasm_bindgen(method, getter = "x")] + pub fn get_x(this: &GpuOrigin3dDict) -> Option; #[doc = "Change the `x` field of this object."] #[doc = ""] @@ -56,16 +51,17 @@ impl GpuOrigin3dDict { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn x(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("x"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "x")] + pub fn set_x(this: &GpuOrigin3dDict, val: u32); + + #[doc = "Get the `y` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuOrigin3dDict`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "y")] + pub fn get_y(this: &GpuOrigin3dDict) -> Option; #[doc = "Change the `y` field of this object."] #[doc = ""] @@ -73,16 +69,17 @@ impl GpuOrigin3dDict { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn y(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("y"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "y")] + pub fn set_y(this: &GpuOrigin3dDict, val: u32); + + #[doc = "Get the `z` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuOrigin3dDict`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "z")] + pub fn get_z(this: &GpuOrigin3dDict) -> Option; #[doc = "Change the `z` field of this object."] #[doc = ""] @@ -90,14 +87,38 @@ impl GpuOrigin3dDict { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "z")] + pub fn set_z(this: &GpuOrigin3dDict, val: u32); +} + +impl GpuOrigin3dDict { + #[doc = "Construct a new `GpuOrigin3dDict`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuOrigin3dDict`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new() -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret + } + + #[deprecated = "Use `set_x()` instead."] + pub fn x(&mut self, val: u32) -> &mut Self { + self.set_x(val); + self + } + + #[deprecated = "Use `set_y()` instead."] + pub fn y(&mut self, val: u32) -> &mut Self { + self.set_y(val); + self + } + + #[deprecated = "Use `set_z()` instead."] pub fn z(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("z"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_z(val); self } } diff --git a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuOutOfMemoryError.rs b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuOutOfMemoryError.rs index 6f1aa56400..6affb6550f 100644 --- a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuOutOfMemoryError.rs +++ b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuOutOfMemoryError.rs @@ -18,7 +18,7 @@ // // If you want to improve the generated code, please submit a PR to the https://github.com/rustwasm/wasm-bindgen repository. // -// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.91` command. +// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.97` command. #![allow(unused_imports)] #![allow(clippy::all)] use super::*; diff --git a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuPipelineDescriptorBase.rs b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuPipelineDescriptorBase.rs index 8c85565b46..17b6708644 100644 --- a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuPipelineDescriptorBase.rs +++ b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuPipelineDescriptorBase.rs @@ -18,7 +18,7 @@ // // If you want to improve the generated code, please submit a PR to the https://github.com/rustwasm/wasm-bindgen repository. // -// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.91` command. +// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.97` command. #![allow(unused_imports)] #![allow(clippy::all)] use super::*; @@ -35,21 +35,15 @@ extern "C" { #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub type GpuPipelineDescriptorBase; -} -impl GpuPipelineDescriptorBase { - #[doc = "Construct a new `GpuPipelineDescriptorBase`."] + #[doc = "Get the `label` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `GpuPipelineDescriptorBase`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn new(layout: &::wasm_bindgen::JsValue) -> Self { - #[allow(unused_mut)] - let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); - ret.layout(layout); - ret - } + #[wasm_bindgen(method, getter = "label")] + pub fn get_label(this: &GpuPipelineDescriptorBase) -> Option<::alloc::string::String>; #[doc = "Change the `label` field of this object."] #[doc = ""] @@ -57,16 +51,17 @@ impl GpuPipelineDescriptorBase { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn label(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("label"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "label")] + pub fn set_label(this: &GpuPipelineDescriptorBase, val: &str); + + #[doc = "Get the `layout` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuPipelineDescriptorBase`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "layout")] + pub fn get_layout(this: &GpuPipelineDescriptorBase) -> ::wasm_bindgen::JsValue; #[doc = "Change the `layout` field of this object."] #[doc = ""] @@ -74,15 +69,33 @@ impl GpuPipelineDescriptorBase { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "layout")] + pub fn set_layout(this: &GpuPipelineDescriptorBase, val: &::wasm_bindgen::JsValue); +} + +impl GpuPipelineDescriptorBase { + #[doc = "Construct a new `GpuPipelineDescriptorBase`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuPipelineDescriptorBase`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new(layout: &::wasm_bindgen::JsValue) -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret.set_layout(layout); + ret + } + + #[deprecated = "Use `set_label()` instead."] + pub fn label(&mut self, val: &str) -> &mut Self { + self.set_label(val); + self + } + + #[deprecated = "Use `set_layout()` instead."] pub fn layout(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("layout"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_layout(val); self } } diff --git a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuPipelineLayout.rs b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuPipelineLayout.rs index b394401cbe..659e4d5769 100644 --- a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuPipelineLayout.rs +++ b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuPipelineLayout.rs @@ -18,7 +18,7 @@ // // If you want to improve the generated code, please submit a PR to the https://github.com/rustwasm/wasm-bindgen repository. // -// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.91` command. +// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.97` command. #![allow(unused_imports)] #![allow(clippy::all)] use super::*; @@ -47,7 +47,7 @@ extern "C" { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn label(this: &GpuPipelineLayout) -> String; + pub fn label(this: &GpuPipelineLayout) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "GPUPipelineLayout" , js_name = label)] #[doc = "Setter for the `label` field of this object."] diff --git a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuPipelineLayoutDescriptor.rs b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuPipelineLayoutDescriptor.rs index 37df0d7da1..8d63b6e599 100644 --- a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuPipelineLayoutDescriptor.rs +++ b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuPipelineLayoutDescriptor.rs @@ -18,7 +18,7 @@ // // If you want to improve the generated code, please submit a PR to the https://github.com/rustwasm/wasm-bindgen repository. // -// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.91` command. +// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.97` command. #![allow(unused_imports)] #![allow(clippy::all)] use super::*; @@ -35,21 +35,15 @@ extern "C" { #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub type GpuPipelineLayoutDescriptor; -} -impl GpuPipelineLayoutDescriptor { - #[doc = "Construct a new `GpuPipelineLayoutDescriptor`."] + #[doc = "Get the `label` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `GpuPipelineLayoutDescriptor`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn new(bind_group_layouts: &::wasm_bindgen::JsValue) -> Self { - #[allow(unused_mut)] - let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); - ret.bind_group_layouts(bind_group_layouts); - ret - } + #[wasm_bindgen(method, getter = "label")] + pub fn get_label(this: &GpuPipelineLayoutDescriptor) -> Option<::alloc::string::String>; #[doc = "Change the `label` field of this object."] #[doc = ""] @@ -57,16 +51,17 @@ impl GpuPipelineLayoutDescriptor { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn label(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("label"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "label")] + pub fn set_label(this: &GpuPipelineLayoutDescriptor, val: &str); + + #[doc = "Get the `bindGroupLayouts` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuPipelineLayoutDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "bindGroupLayouts")] + pub fn get_bind_group_layouts(this: &GpuPipelineLayoutDescriptor) -> ::js_sys::Array; #[doc = "Change the `bindGroupLayouts` field of this object."] #[doc = ""] @@ -74,18 +69,36 @@ impl GpuPipelineLayoutDescriptor { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "bindGroupLayouts")] + pub fn set_bind_group_layouts( + this: &GpuPipelineLayoutDescriptor, + val: &::wasm_bindgen::JsValue, + ); +} + +impl GpuPipelineLayoutDescriptor { + #[doc = "Construct a new `GpuPipelineLayoutDescriptor`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuPipelineLayoutDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new(bind_group_layouts: &::wasm_bindgen::JsValue) -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret.set_bind_group_layouts(bind_group_layouts); + ret + } + + #[deprecated = "Use `set_label()` instead."] + pub fn label(&mut self, val: &str) -> &mut Self { + self.set_label(val); + self + } + + #[deprecated = "Use `set_bind_group_layouts()` instead."] pub fn bind_group_layouts(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("bindGroupLayouts"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_bind_group_layouts(val); self } } diff --git a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuPowerPreference.rs b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuPowerPreference.rs index 85ca517aee..5b0209b068 100644 --- a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuPowerPreference.rs +++ b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuPowerPreference.rs @@ -18,7 +18,7 @@ // // If you want to improve the generated code, please submit a PR to the https://github.com/rustwasm/wasm-bindgen repository. // -// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.91` command. +// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.97` command. #![allow(unused_imports)] #![allow(clippy::all)] use wasm_bindgen::prelude::*; diff --git a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuPrimitiveState.rs b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuPrimitiveState.rs index 13886c3a71..8ac4acecc9 100644 --- a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuPrimitiveState.rs +++ b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuPrimitiveState.rs @@ -18,7 +18,7 @@ // // If you want to improve the generated code, please submit a PR to the https://github.com/rustwasm/wasm-bindgen repository. // -// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.91` command. +// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.97` command. #![allow(unused_imports)] #![allow(clippy::all)] use super::*; @@ -35,20 +35,15 @@ extern "C" { #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub type GpuPrimitiveState; -} -impl GpuPrimitiveState { - #[doc = "Construct a new `GpuPrimitiveState`."] + #[doc = "Get the `cullMode` field of this object."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuPrimitiveState`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuCullMode`, `GpuPrimitiveState`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn new() -> Self { - #[allow(unused_mut)] - let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); - ret - } + #[wasm_bindgen(method, getter = "cullMode")] + pub fn get_cull_mode(this: &GpuPrimitiveState) -> Option; #[doc = "Change the `cullMode` field of this object."] #[doc = ""] @@ -56,20 +51,17 @@ impl GpuPrimitiveState { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn cull_mode(&mut self, val: GpuCullMode) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("cullMode"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "cullMode")] + pub fn set_cull_mode(this: &GpuPrimitiveState, val: GpuCullMode); + + #[doc = "Get the `frontFace` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuFrontFace`, `GpuPrimitiveState`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "frontFace")] + pub fn get_front_face(this: &GpuPrimitiveState) -> Option; #[doc = "Change the `frontFace` field of this object."] #[doc = ""] @@ -77,20 +69,17 @@ impl GpuPrimitiveState { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn front_face(&mut self, val: GpuFrontFace) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("frontFace"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "frontFace")] + pub fn set_front_face(this: &GpuPrimitiveState, val: GpuFrontFace); + + #[doc = "Get the `stripIndexFormat` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuIndexFormat`, `GpuPrimitiveState`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "stripIndexFormat")] + pub fn get_strip_index_format(this: &GpuPrimitiveState) -> Option; #[doc = "Change the `stripIndexFormat` field of this object."] #[doc = ""] @@ -98,20 +87,17 @@ impl GpuPrimitiveState { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn strip_index_format(&mut self, val: GpuIndexFormat) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("stripIndexFormat"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "stripIndexFormat")] + pub fn set_strip_index_format(this: &GpuPrimitiveState, val: GpuIndexFormat); + + #[doc = "Get the `topology` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuPrimitiveState`, `GpuPrimitiveTopology`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "topology")] + pub fn get_topology(this: &GpuPrimitiveState) -> Option; #[doc = "Change the `topology` field of this object."] #[doc = ""] @@ -119,20 +105,17 @@ impl GpuPrimitiveState { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn topology(&mut self, val: GpuPrimitiveTopology) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("topology"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "topology")] + pub fn set_topology(this: &GpuPrimitiveState, val: GpuPrimitiveTopology); + + #[doc = "Get the `unclippedDepth` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuPrimitiveState`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "unclippedDepth")] + pub fn get_unclipped_depth(this: &GpuPrimitiveState) -> Option; #[doc = "Change the `unclippedDepth` field of this object."] #[doc = ""] @@ -140,18 +123,50 @@ impl GpuPrimitiveState { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "unclippedDepth")] + pub fn set_unclipped_depth(this: &GpuPrimitiveState, val: bool); +} + +impl GpuPrimitiveState { + #[doc = "Construct a new `GpuPrimitiveState`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuPrimitiveState`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new() -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret + } + + #[deprecated = "Use `set_cull_mode()` instead."] + pub fn cull_mode(&mut self, val: GpuCullMode) -> &mut Self { + self.set_cull_mode(val); + self + } + + #[deprecated = "Use `set_front_face()` instead."] + pub fn front_face(&mut self, val: GpuFrontFace) -> &mut Self { + self.set_front_face(val); + self + } + + #[deprecated = "Use `set_strip_index_format()` instead."] + pub fn strip_index_format(&mut self, val: GpuIndexFormat) -> &mut Self { + self.set_strip_index_format(val); + self + } + + #[deprecated = "Use `set_topology()` instead."] + pub fn topology(&mut self, val: GpuPrimitiveTopology) -> &mut Self { + self.set_topology(val); + self + } + + #[deprecated = "Use `set_unclipped_depth()` instead."] pub fn unclipped_depth(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("unclippedDepth"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_unclipped_depth(val); self } } diff --git a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuPrimitiveTopology.rs b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuPrimitiveTopology.rs index 4e603eb816..157a37fede 100644 --- a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuPrimitiveTopology.rs +++ b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuPrimitiveTopology.rs @@ -18,7 +18,7 @@ // // If you want to improve the generated code, please submit a PR to the https://github.com/rustwasm/wasm-bindgen repository. // -// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.91` command. +// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.97` command. #![allow(unused_imports)] #![allow(clippy::all)] use wasm_bindgen::prelude::*; diff --git a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuProgrammableStage.rs b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuProgrammableStage.rs index b6992f7164..b1c526cd02 100644 --- a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuProgrammableStage.rs +++ b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuProgrammableStage.rs @@ -18,7 +18,7 @@ // // If you want to improve the generated code, please submit a PR to the https://github.com/rustwasm/wasm-bindgen repository. // -// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.91` command. +// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.97` command. #![allow(unused_imports)] #![allow(clippy::all)] use super::*; @@ -35,21 +35,33 @@ extern "C" { #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub type GpuProgrammableStage; -} -impl GpuProgrammableStage { - #[doc = "Construct a new `GpuProgrammableStage`."] + #[doc = "Get the `constants` field of this object."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuProgrammableStage`, `GpuShaderModule`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuProgrammableStage`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn new(module: &GpuShaderModule) -> Self { - #[allow(unused_mut)] - let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); - ret.module(module); - ret - } + #[wasm_bindgen(method, getter = "constants")] + pub fn get_constants(this: &GpuProgrammableStage) -> Option<::js_sys::Object>; + + #[doc = "Change the `constants` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuProgrammableStage`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "constants")] + pub fn set_constants(this: &GpuProgrammableStage, val: &::js_sys::Object); + + #[doc = "Get the `entryPoint` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuProgrammableStage`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "entryPoint")] + pub fn get_entry_point(this: &GpuProgrammableStage) -> Option<::alloc::string::String>; #[doc = "Change the `entryPoint` field of this object."] #[doc = ""] @@ -57,20 +69,17 @@ impl GpuProgrammableStage { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn entry_point(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("entryPoint"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "entryPoint")] + pub fn set_entry_point(this: &GpuProgrammableStage, val: &str); + + #[doc = "Get the `module` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuProgrammableStage`, `GpuShaderModule`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "module")] + pub fn get_module(this: &GpuProgrammableStage) -> GpuShaderModule; #[doc = "Change the `module` field of this object."] #[doc = ""] @@ -78,15 +87,39 @@ impl GpuProgrammableStage { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "module")] + pub fn set_module(this: &GpuProgrammableStage, val: &GpuShaderModule); +} + +impl GpuProgrammableStage { + #[doc = "Construct a new `GpuProgrammableStage`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuProgrammableStage`, `GpuShaderModule`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new(module: &GpuShaderModule) -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret.set_module(module); + ret + } + + #[deprecated = "Use `set_constants()` instead."] + pub fn constants(&mut self, val: &::js_sys::Object) -> &mut Self { + self.set_constants(val); + self + } + + #[deprecated = "Use `set_entry_point()` instead."] + pub fn entry_point(&mut self, val: &str) -> &mut Self { + self.set_entry_point(val); + self + } + + #[deprecated = "Use `set_module()` instead."] pub fn module(&mut self, val: &GpuShaderModule) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("module"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_module(val); self } } diff --git a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuQuerySet.rs b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuQuerySet.rs index 2ae2993542..5d103a487e 100644 --- a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuQuerySet.rs +++ b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuQuerySet.rs @@ -18,7 +18,7 @@ // // If you want to improve the generated code, please submit a PR to the https://github.com/rustwasm/wasm-bindgen repository. // -// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.91` command. +// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.97` command. #![allow(unused_imports)] #![allow(clippy::all)] use super::*; @@ -69,7 +69,7 @@ extern "C" { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn label(this: &GpuQuerySet) -> String; + pub fn label(this: &GpuQuerySet) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "GPUQuerySet" , js_name = label)] #[doc = "Setter for the `label` field of this object."] diff --git a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuQuerySetDescriptor.rs b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuQuerySetDescriptor.rs index c291f894fb..6c3716e5d3 100644 --- a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuQuerySetDescriptor.rs +++ b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuQuerySetDescriptor.rs @@ -18,7 +18,7 @@ // // If you want to improve the generated code, please submit a PR to the https://github.com/rustwasm/wasm-bindgen repository. // -// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.91` command. +// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.97` command. #![allow(unused_imports)] #![allow(clippy::all)] use super::*; @@ -35,22 +35,15 @@ extern "C" { #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub type GpuQuerySetDescriptor; -} -impl GpuQuerySetDescriptor { - #[doc = "Construct a new `GpuQuerySetDescriptor`."] + #[doc = "Get the `label` field of this object."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuQuerySetDescriptor`, `GpuQueryType`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuQuerySetDescriptor`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn new(count: u32, type_: GpuQueryType) -> Self { - #[allow(unused_mut)] - let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); - ret.count(count); - ret.type_(type_); - ret - } + #[wasm_bindgen(method, getter = "label")] + pub fn get_label(this: &GpuQuerySetDescriptor) -> Option<::alloc::string::String>; #[doc = "Change the `label` field of this object."] #[doc = ""] @@ -58,16 +51,17 @@ impl GpuQuerySetDescriptor { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn label(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("label"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "label")] + pub fn set_label(this: &GpuQuerySetDescriptor, val: &str); + + #[doc = "Get the `count` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuQuerySetDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "count")] + pub fn get_count(this: &GpuQuerySetDescriptor) -> u32; #[doc = "Change the `count` field of this object."] #[doc = ""] @@ -75,16 +69,17 @@ impl GpuQuerySetDescriptor { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn count(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("count"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "count")] + pub fn set_count(this: &GpuQuerySetDescriptor, val: u32); + + #[doc = "Get the `type` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuQuerySetDescriptor`, `GpuQueryType`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "type")] + pub fn get_type(this: &GpuQuerySetDescriptor) -> GpuQueryType; #[doc = "Change the `type` field of this object."] #[doc = ""] @@ -92,14 +87,40 @@ impl GpuQuerySetDescriptor { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "type")] + pub fn set_type(this: &GpuQuerySetDescriptor, val: GpuQueryType); +} + +impl GpuQuerySetDescriptor { + #[doc = "Construct a new `GpuQuerySetDescriptor`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuQuerySetDescriptor`, `GpuQueryType`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new(count: u32, type_: GpuQueryType) -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret.set_count(count); + ret.set_type(type_); + ret + } + + #[deprecated = "Use `set_label()` instead."] + pub fn label(&mut self, val: &str) -> &mut Self { + self.set_label(val); + self + } + + #[deprecated = "Use `set_count()` instead."] + pub fn count(&mut self, val: u32) -> &mut Self { + self.set_count(val); + self + } + + #[deprecated = "Use `set_type()` instead."] pub fn type_(&mut self, val: GpuQueryType) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("type"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_type(val); self } } diff --git a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuQueryType.rs b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuQueryType.rs index ed8d7f9cc3..eb845fefae 100644 --- a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuQueryType.rs +++ b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuQueryType.rs @@ -18,7 +18,7 @@ // // If you want to improve the generated code, please submit a PR to the https://github.com/rustwasm/wasm-bindgen repository. // -// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.91` command. +// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.97` command. #![allow(unused_imports)] #![allow(clippy::all)] use wasm_bindgen::prelude::*; diff --git a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuQueue.rs b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuQueue.rs index 51f1e0e000..b69151efe3 100644 --- a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuQueue.rs +++ b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuQueue.rs @@ -18,7 +18,7 @@ // // If you want to improve the generated code, please submit a PR to the https://github.com/rustwasm/wasm-bindgen repository. // -// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.91` command. +// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.97` command. #![allow(unused_imports)] #![allow(clippy::all)] use super::*; @@ -47,7 +47,7 @@ extern "C" { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn label(this: &GpuQueue) -> String; + pub fn label(this: &GpuQueue) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "GPUQueue" , js_name = label)] #[doc = "Setter for the `label` field of this object."] @@ -60,37 +60,37 @@ extern "C" { #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn set_label(this: &GpuQueue, value: &str); - # [wasm_bindgen (method , structural , js_class = "GPUQueue" , js_name = copyExternalImageToTexture)] + # [wasm_bindgen (catch , method , structural , js_class = "GPUQueue" , js_name = copyExternalImageToTexture)] #[doc = "The `copyExternalImageToTexture()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUQueue/copyExternalImageToTexture)"] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuImageCopyExternalImage`, `GpuImageCopyTextureTagged`, `GpuQueue`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuCopyExternalImageDestInfo`, `GpuCopyExternalImageSourceInfo`, `GpuQueue`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn copy_external_image_to_texture_with_u32_sequence( this: &GpuQueue, - source: &GpuImageCopyExternalImage, - destination: &GpuImageCopyTextureTagged, + source: &GpuCopyExternalImageSourceInfo, + destination: &GpuCopyExternalImageDestInfo, copy_size: &::wasm_bindgen::JsValue, - ); + ) -> Result<(), JsValue>; - # [wasm_bindgen (method , structural , js_class = "GPUQueue" , js_name = copyExternalImageToTexture)] + # [wasm_bindgen (catch , method , structural , js_class = "GPUQueue" , js_name = copyExternalImageToTexture)] #[doc = "The `copyExternalImageToTexture()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUQueue/copyExternalImageToTexture)"] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuExtent3dDict`, `GpuImageCopyExternalImage`, `GpuImageCopyTextureTagged`, `GpuQueue`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuCopyExternalImageDestInfo`, `GpuCopyExternalImageSourceInfo`, `GpuExtent3dDict`, `GpuQueue`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn copy_external_image_to_texture_with_gpu_extent_3d_dict( this: &GpuQueue, - source: &GpuImageCopyExternalImage, - destination: &GpuImageCopyTextureTagged, + source: &GpuCopyExternalImageSourceInfo, + destination: &GpuCopyExternalImageDestInfo, copy_size: &GpuExtent3dDict, - ); + ) -> Result<(), JsValue>; # [wasm_bindgen (method , structural , js_class = "GPUQueue" , js_name = onSubmittedWorkDone)] #[doc = "The `onSubmittedWorkDone()` method."] @@ -114,7 +114,7 @@ extern "C" { #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn submit(this: &GpuQueue, command_buffers: &::wasm_bindgen::JsValue); - # [wasm_bindgen (method , structural , js_class = "GPUQueue" , js_name = writeBuffer)] + # [wasm_bindgen (catch , method , structural , js_class = "GPUQueue" , js_name = writeBuffer)] #[doc = "The `writeBuffer()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUQueue/writeBuffer)"] @@ -128,9 +128,9 @@ extern "C" { buffer: &GpuBuffer, buffer_offset: u32, data: &::js_sys::Object, - ); + ) -> Result<(), JsValue>; - # [wasm_bindgen (method , structural , js_class = "GPUQueue" , js_name = writeBuffer)] + # [wasm_bindgen (catch , method , structural , js_class = "GPUQueue" , js_name = writeBuffer)] #[doc = "The `writeBuffer()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUQueue/writeBuffer)"] @@ -144,9 +144,9 @@ extern "C" { buffer: &GpuBuffer, buffer_offset: f64, data: &::js_sys::Object, - ); + ) -> Result<(), JsValue>; - # [wasm_bindgen (method , structural , js_class = "GPUQueue" , js_name = writeBuffer)] + # [wasm_bindgen (catch , method , structural , js_class = "GPUQueue" , js_name = writeBuffer)] #[doc = "The `writeBuffer()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUQueue/writeBuffer)"] @@ -155,14 +155,14 @@ extern "C" { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn write_buffer_with_u32_and_u8_array( + pub fn write_buffer_with_u32_and_u8_slice( this: &GpuQueue, buffer: &GpuBuffer, buffer_offset: u32, data: &[u8], - ); + ) -> Result<(), JsValue>; - # [wasm_bindgen (method , structural , js_class = "GPUQueue" , js_name = writeBuffer)] + # [wasm_bindgen (catch , method , structural , js_class = "GPUQueue" , js_name = writeBuffer)] #[doc = "The `writeBuffer()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUQueue/writeBuffer)"] @@ -171,14 +171,46 @@ extern "C" { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn write_buffer_with_f64_and_u8_array( + pub fn write_buffer_with_f64_and_u8_slice( this: &GpuQueue, buffer: &GpuBuffer, buffer_offset: f64, data: &[u8], - ); + ) -> Result<(), JsValue>; + + # [wasm_bindgen (catch , method , structural , js_class = "GPUQueue" , js_name = writeBuffer)] + #[doc = "The `writeBuffer()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUQueue/writeBuffer)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBuffer`, `GpuQueue`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn write_buffer_with_u32_and_u8_array( + this: &GpuQueue, + buffer: &GpuBuffer, + buffer_offset: u32, + data: &::js_sys::Uint8Array, + ) -> Result<(), JsValue>; - # [wasm_bindgen (method , structural , js_class = "GPUQueue" , js_name = writeBuffer)] + # [wasm_bindgen (catch , method , structural , js_class = "GPUQueue" , js_name = writeBuffer)] + #[doc = "The `writeBuffer()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUQueue/writeBuffer)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBuffer`, `GpuQueue`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn write_buffer_with_f64_and_u8_array( + this: &GpuQueue, + buffer: &GpuBuffer, + buffer_offset: f64, + data: &::js_sys::Uint8Array, + ) -> Result<(), JsValue>; + + # [wasm_bindgen (catch , method , structural , js_class = "GPUQueue" , js_name = writeBuffer)] #[doc = "The `writeBuffer()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUQueue/writeBuffer)"] @@ -193,9 +225,9 @@ extern "C" { buffer_offset: u32, data: &::js_sys::Object, data_offset: u32, - ); + ) -> Result<(), JsValue>; - # [wasm_bindgen (method , structural , js_class = "GPUQueue" , js_name = writeBuffer)] + # [wasm_bindgen (catch , method , structural , js_class = "GPUQueue" , js_name = writeBuffer)] #[doc = "The `writeBuffer()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUQueue/writeBuffer)"] @@ -210,9 +242,9 @@ extern "C" { buffer_offset: f64, data: &::js_sys::Object, data_offset: u32, - ); + ) -> Result<(), JsValue>; - # [wasm_bindgen (method , structural , js_class = "GPUQueue" , js_name = writeBuffer)] + # [wasm_bindgen (catch , method , structural , js_class = "GPUQueue" , js_name = writeBuffer)] #[doc = "The `writeBuffer()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUQueue/writeBuffer)"] @@ -221,15 +253,15 @@ extern "C" { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn write_buffer_with_u32_and_u8_array_and_u32( + pub fn write_buffer_with_u32_and_u8_slice_and_u32( this: &GpuQueue, buffer: &GpuBuffer, buffer_offset: u32, data: &[u8], data_offset: u32, - ); + ) -> Result<(), JsValue>; - # [wasm_bindgen (method , structural , js_class = "GPUQueue" , js_name = writeBuffer)] + # [wasm_bindgen (catch , method , structural , js_class = "GPUQueue" , js_name = writeBuffer)] #[doc = "The `writeBuffer()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUQueue/writeBuffer)"] @@ -238,15 +270,49 @@ extern "C" { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn write_buffer_with_f64_and_u8_array_and_u32( + pub fn write_buffer_with_f64_and_u8_slice_and_u32( this: &GpuQueue, buffer: &GpuBuffer, buffer_offset: f64, data: &[u8], data_offset: u32, - ); + ) -> Result<(), JsValue>; - # [wasm_bindgen (method , structural , js_class = "GPUQueue" , js_name = writeBuffer)] + # [wasm_bindgen (catch , method , structural , js_class = "GPUQueue" , js_name = writeBuffer)] + #[doc = "The `writeBuffer()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUQueue/writeBuffer)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBuffer`, `GpuQueue`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn write_buffer_with_u32_and_u8_array_and_u32( + this: &GpuQueue, + buffer: &GpuBuffer, + buffer_offset: u32, + data: &::js_sys::Uint8Array, + data_offset: u32, + ) -> Result<(), JsValue>; + + # [wasm_bindgen (catch , method , structural , js_class = "GPUQueue" , js_name = writeBuffer)] + #[doc = "The `writeBuffer()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUQueue/writeBuffer)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBuffer`, `GpuQueue`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn write_buffer_with_f64_and_u8_array_and_u32( + this: &GpuQueue, + buffer: &GpuBuffer, + buffer_offset: f64, + data: &::js_sys::Uint8Array, + data_offset: u32, + ) -> Result<(), JsValue>; + + # [wasm_bindgen (catch , method , structural , js_class = "GPUQueue" , js_name = writeBuffer)] #[doc = "The `writeBuffer()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUQueue/writeBuffer)"] @@ -261,9 +327,9 @@ extern "C" { buffer_offset: u32, data: &::js_sys::Object, data_offset: f64, - ); + ) -> Result<(), JsValue>; - # [wasm_bindgen (method , structural , js_class = "GPUQueue" , js_name = writeBuffer)] + # [wasm_bindgen (catch , method , structural , js_class = "GPUQueue" , js_name = writeBuffer)] #[doc = "The `writeBuffer()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUQueue/writeBuffer)"] @@ -278,9 +344,9 @@ extern "C" { buffer_offset: f64, data: &::js_sys::Object, data_offset: f64, - ); + ) -> Result<(), JsValue>; - # [wasm_bindgen (method , structural , js_class = "GPUQueue" , js_name = writeBuffer)] + # [wasm_bindgen (catch , method , structural , js_class = "GPUQueue" , js_name = writeBuffer)] #[doc = "The `writeBuffer()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUQueue/writeBuffer)"] @@ -289,15 +355,15 @@ extern "C" { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn write_buffer_with_u32_and_u8_array_and_f64( + pub fn write_buffer_with_u32_and_u8_slice_and_f64( this: &GpuQueue, buffer: &GpuBuffer, buffer_offset: u32, data: &[u8], data_offset: f64, - ); + ) -> Result<(), JsValue>; - # [wasm_bindgen (method , structural , js_class = "GPUQueue" , js_name = writeBuffer)] + # [wasm_bindgen (catch , method , structural , js_class = "GPUQueue" , js_name = writeBuffer)] #[doc = "The `writeBuffer()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUQueue/writeBuffer)"] @@ -306,15 +372,49 @@ extern "C" { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn write_buffer_with_f64_and_u8_array_and_f64( + pub fn write_buffer_with_f64_and_u8_slice_and_f64( this: &GpuQueue, buffer: &GpuBuffer, buffer_offset: f64, data: &[u8], data_offset: f64, - ); + ) -> Result<(), JsValue>; - # [wasm_bindgen (method , structural , js_class = "GPUQueue" , js_name = writeBuffer)] + # [wasm_bindgen (catch , method , structural , js_class = "GPUQueue" , js_name = writeBuffer)] + #[doc = "The `writeBuffer()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUQueue/writeBuffer)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBuffer`, `GpuQueue`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn write_buffer_with_u32_and_u8_array_and_f64( + this: &GpuQueue, + buffer: &GpuBuffer, + buffer_offset: u32, + data: &::js_sys::Uint8Array, + data_offset: f64, + ) -> Result<(), JsValue>; + + # [wasm_bindgen (catch , method , structural , js_class = "GPUQueue" , js_name = writeBuffer)] + #[doc = "The `writeBuffer()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUQueue/writeBuffer)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBuffer`, `GpuQueue`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn write_buffer_with_f64_and_u8_array_and_f64( + this: &GpuQueue, + buffer: &GpuBuffer, + buffer_offset: f64, + data: &::js_sys::Uint8Array, + data_offset: f64, + ) -> Result<(), JsValue>; + + # [wasm_bindgen (catch , method , structural , js_class = "GPUQueue" , js_name = writeBuffer)] #[doc = "The `writeBuffer()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUQueue/writeBuffer)"] @@ -330,9 +430,9 @@ extern "C" { data: &::js_sys::Object, data_offset: u32, size: u32, - ); + ) -> Result<(), JsValue>; - # [wasm_bindgen (method , structural , js_class = "GPUQueue" , js_name = writeBuffer)] + # [wasm_bindgen (catch , method , structural , js_class = "GPUQueue" , js_name = writeBuffer)] #[doc = "The `writeBuffer()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUQueue/writeBuffer)"] @@ -348,9 +448,9 @@ extern "C" { data: &::js_sys::Object, data_offset: u32, size: u32, - ); + ) -> Result<(), JsValue>; - # [wasm_bindgen (method , structural , js_class = "GPUQueue" , js_name = writeBuffer)] + # [wasm_bindgen (catch , method , structural , js_class = "GPUQueue" , js_name = writeBuffer)] #[doc = "The `writeBuffer()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUQueue/writeBuffer)"] @@ -359,16 +459,16 @@ extern "C" { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn write_buffer_with_u32_and_u8_array_and_u32_and_u32( + pub fn write_buffer_with_u32_and_u8_slice_and_u32_and_u32( this: &GpuQueue, buffer: &GpuBuffer, buffer_offset: u32, data: &[u8], data_offset: u32, size: u32, - ); + ) -> Result<(), JsValue>; - # [wasm_bindgen (method , structural , js_class = "GPUQueue" , js_name = writeBuffer)] + # [wasm_bindgen (catch , method , structural , js_class = "GPUQueue" , js_name = writeBuffer)] #[doc = "The `writeBuffer()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUQueue/writeBuffer)"] @@ -377,16 +477,52 @@ extern "C" { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn write_buffer_with_f64_and_u8_array_and_u32_and_u32( + pub fn write_buffer_with_f64_and_u8_slice_and_u32_and_u32( this: &GpuQueue, buffer: &GpuBuffer, buffer_offset: f64, data: &[u8], data_offset: u32, size: u32, - ); + ) -> Result<(), JsValue>; + + # [wasm_bindgen (catch , method , structural , js_class = "GPUQueue" , js_name = writeBuffer)] + #[doc = "The `writeBuffer()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUQueue/writeBuffer)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBuffer`, `GpuQueue`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn write_buffer_with_u32_and_u8_array_and_u32_and_u32( + this: &GpuQueue, + buffer: &GpuBuffer, + buffer_offset: u32, + data: &::js_sys::Uint8Array, + data_offset: u32, + size: u32, + ) -> Result<(), JsValue>; + + # [wasm_bindgen (catch , method , structural , js_class = "GPUQueue" , js_name = writeBuffer)] + #[doc = "The `writeBuffer()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUQueue/writeBuffer)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBuffer`, `GpuQueue`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn write_buffer_with_f64_and_u8_array_and_u32_and_u32( + this: &GpuQueue, + buffer: &GpuBuffer, + buffer_offset: f64, + data: &::js_sys::Uint8Array, + data_offset: u32, + size: u32, + ) -> Result<(), JsValue>; - # [wasm_bindgen (method , structural , js_class = "GPUQueue" , js_name = writeBuffer)] + # [wasm_bindgen (catch , method , structural , js_class = "GPUQueue" , js_name = writeBuffer)] #[doc = "The `writeBuffer()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUQueue/writeBuffer)"] @@ -402,9 +538,9 @@ extern "C" { data: &::js_sys::Object, data_offset: f64, size: u32, - ); + ) -> Result<(), JsValue>; - # [wasm_bindgen (method , structural , js_class = "GPUQueue" , js_name = writeBuffer)] + # [wasm_bindgen (catch , method , structural , js_class = "GPUQueue" , js_name = writeBuffer)] #[doc = "The `writeBuffer()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUQueue/writeBuffer)"] @@ -420,9 +556,9 @@ extern "C" { data: &::js_sys::Object, data_offset: f64, size: u32, - ); + ) -> Result<(), JsValue>; - # [wasm_bindgen (method , structural , js_class = "GPUQueue" , js_name = writeBuffer)] + # [wasm_bindgen (catch , method , structural , js_class = "GPUQueue" , js_name = writeBuffer)] #[doc = "The `writeBuffer()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUQueue/writeBuffer)"] @@ -431,16 +567,16 @@ extern "C" { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn write_buffer_with_u32_and_u8_array_and_f64_and_u32( + pub fn write_buffer_with_u32_and_u8_slice_and_f64_and_u32( this: &GpuQueue, buffer: &GpuBuffer, buffer_offset: u32, data: &[u8], data_offset: f64, size: u32, - ); + ) -> Result<(), JsValue>; - # [wasm_bindgen (method , structural , js_class = "GPUQueue" , js_name = writeBuffer)] + # [wasm_bindgen (catch , method , structural , js_class = "GPUQueue" , js_name = writeBuffer)] #[doc = "The `writeBuffer()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUQueue/writeBuffer)"] @@ -449,16 +585,52 @@ extern "C" { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn write_buffer_with_f64_and_u8_array_and_f64_and_u32( + pub fn write_buffer_with_f64_and_u8_slice_and_f64_and_u32( this: &GpuQueue, buffer: &GpuBuffer, buffer_offset: f64, data: &[u8], data_offset: f64, size: u32, - ); + ) -> Result<(), JsValue>; + + # [wasm_bindgen (catch , method , structural , js_class = "GPUQueue" , js_name = writeBuffer)] + #[doc = "The `writeBuffer()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUQueue/writeBuffer)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBuffer`, `GpuQueue`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn write_buffer_with_u32_and_u8_array_and_f64_and_u32( + this: &GpuQueue, + buffer: &GpuBuffer, + buffer_offset: u32, + data: &::js_sys::Uint8Array, + data_offset: f64, + size: u32, + ) -> Result<(), JsValue>; + + # [wasm_bindgen (catch , method , structural , js_class = "GPUQueue" , js_name = writeBuffer)] + #[doc = "The `writeBuffer()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUQueue/writeBuffer)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBuffer`, `GpuQueue`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn write_buffer_with_f64_and_u8_array_and_f64_and_u32( + this: &GpuQueue, + buffer: &GpuBuffer, + buffer_offset: f64, + data: &::js_sys::Uint8Array, + data_offset: f64, + size: u32, + ) -> Result<(), JsValue>; - # [wasm_bindgen (method , structural , js_class = "GPUQueue" , js_name = writeBuffer)] + # [wasm_bindgen (catch , method , structural , js_class = "GPUQueue" , js_name = writeBuffer)] #[doc = "The `writeBuffer()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUQueue/writeBuffer)"] @@ -474,9 +646,9 @@ extern "C" { data: &::js_sys::Object, data_offset: u32, size: f64, - ); + ) -> Result<(), JsValue>; - # [wasm_bindgen (method , structural , js_class = "GPUQueue" , js_name = writeBuffer)] + # [wasm_bindgen (catch , method , structural , js_class = "GPUQueue" , js_name = writeBuffer)] #[doc = "The `writeBuffer()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUQueue/writeBuffer)"] @@ -492,9 +664,9 @@ extern "C" { data: &::js_sys::Object, data_offset: u32, size: f64, - ); + ) -> Result<(), JsValue>; - # [wasm_bindgen (method , structural , js_class = "GPUQueue" , js_name = writeBuffer)] + # [wasm_bindgen (catch , method , structural , js_class = "GPUQueue" , js_name = writeBuffer)] #[doc = "The `writeBuffer()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUQueue/writeBuffer)"] @@ -503,16 +675,16 @@ extern "C" { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn write_buffer_with_u32_and_u8_array_and_u32_and_f64( + pub fn write_buffer_with_u32_and_u8_slice_and_u32_and_f64( this: &GpuQueue, buffer: &GpuBuffer, buffer_offset: u32, data: &[u8], data_offset: u32, size: f64, - ); + ) -> Result<(), JsValue>; - # [wasm_bindgen (method , structural , js_class = "GPUQueue" , js_name = writeBuffer)] + # [wasm_bindgen (catch , method , structural , js_class = "GPUQueue" , js_name = writeBuffer)] #[doc = "The `writeBuffer()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUQueue/writeBuffer)"] @@ -521,16 +693,52 @@ extern "C" { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn write_buffer_with_f64_and_u8_array_and_u32_and_f64( + pub fn write_buffer_with_f64_and_u8_slice_and_u32_and_f64( this: &GpuQueue, buffer: &GpuBuffer, buffer_offset: f64, data: &[u8], data_offset: u32, size: f64, - ); + ) -> Result<(), JsValue>; + + # [wasm_bindgen (catch , method , structural , js_class = "GPUQueue" , js_name = writeBuffer)] + #[doc = "The `writeBuffer()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUQueue/writeBuffer)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBuffer`, `GpuQueue`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn write_buffer_with_u32_and_u8_array_and_u32_and_f64( + this: &GpuQueue, + buffer: &GpuBuffer, + buffer_offset: u32, + data: &::js_sys::Uint8Array, + data_offset: u32, + size: f64, + ) -> Result<(), JsValue>; + + # [wasm_bindgen (catch , method , structural , js_class = "GPUQueue" , js_name = writeBuffer)] + #[doc = "The `writeBuffer()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUQueue/writeBuffer)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBuffer`, `GpuQueue`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn write_buffer_with_f64_and_u8_array_and_u32_and_f64( + this: &GpuQueue, + buffer: &GpuBuffer, + buffer_offset: f64, + data: &::js_sys::Uint8Array, + data_offset: u32, + size: f64, + ) -> Result<(), JsValue>; - # [wasm_bindgen (method , structural , js_class = "GPUQueue" , js_name = writeBuffer)] + # [wasm_bindgen (catch , method , structural , js_class = "GPUQueue" , js_name = writeBuffer)] #[doc = "The `writeBuffer()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUQueue/writeBuffer)"] @@ -546,9 +754,9 @@ extern "C" { data: &::js_sys::Object, data_offset: f64, size: f64, - ); + ) -> Result<(), JsValue>; - # [wasm_bindgen (method , structural , js_class = "GPUQueue" , js_name = writeBuffer)] + # [wasm_bindgen (catch , method , structural , js_class = "GPUQueue" , js_name = writeBuffer)] #[doc = "The `writeBuffer()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUQueue/writeBuffer)"] @@ -564,9 +772,9 @@ extern "C" { data: &::js_sys::Object, data_offset: f64, size: f64, - ); + ) -> Result<(), JsValue>; - # [wasm_bindgen (method , structural , js_class = "GPUQueue" , js_name = writeBuffer)] + # [wasm_bindgen (catch , method , structural , js_class = "GPUQueue" , js_name = writeBuffer)] #[doc = "The `writeBuffer()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUQueue/writeBuffer)"] @@ -575,16 +783,16 @@ extern "C" { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn write_buffer_with_u32_and_u8_array_and_f64_and_f64( + pub fn write_buffer_with_u32_and_u8_slice_and_f64_and_f64( this: &GpuQueue, buffer: &GpuBuffer, buffer_offset: u32, data: &[u8], data_offset: f64, size: f64, - ); + ) -> Result<(), JsValue>; - # [wasm_bindgen (method , structural , js_class = "GPUQueue" , js_name = writeBuffer)] + # [wasm_bindgen (catch , method , structural , js_class = "GPUQueue" , js_name = writeBuffer)] #[doc = "The `writeBuffer()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUQueue/writeBuffer)"] @@ -593,80 +801,150 @@ extern "C" { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn write_buffer_with_f64_and_u8_array_and_f64_and_f64( + pub fn write_buffer_with_f64_and_u8_slice_and_f64_and_f64( this: &GpuQueue, buffer: &GpuBuffer, buffer_offset: f64, data: &[u8], data_offset: f64, size: f64, - ); + ) -> Result<(), JsValue>; + + # [wasm_bindgen (catch , method , structural , js_class = "GPUQueue" , js_name = writeBuffer)] + #[doc = "The `writeBuffer()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUQueue/writeBuffer)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBuffer`, `GpuQueue`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn write_buffer_with_u32_and_u8_array_and_f64_and_f64( + this: &GpuQueue, + buffer: &GpuBuffer, + buffer_offset: u32, + data: &::js_sys::Uint8Array, + data_offset: f64, + size: f64, + ) -> Result<(), JsValue>; + + # [wasm_bindgen (catch , method , structural , js_class = "GPUQueue" , js_name = writeBuffer)] + #[doc = "The `writeBuffer()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUQueue/writeBuffer)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBuffer`, `GpuQueue`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn write_buffer_with_f64_and_u8_array_and_f64_and_f64( + this: &GpuQueue, + buffer: &GpuBuffer, + buffer_offset: f64, + data: &::js_sys::Uint8Array, + data_offset: f64, + size: f64, + ) -> Result<(), JsValue>; - # [wasm_bindgen (method , structural , js_class = "GPUQueue" , js_name = writeTexture)] + # [wasm_bindgen (catch , method , structural , js_class = "GPUQueue" , js_name = writeTexture)] #[doc = "The `writeTexture()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUQueue/writeTexture)"] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuImageCopyTexture`, `GpuImageDataLayout`, `GpuQueue`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuQueue`, `GpuTexelCopyBufferLayout`, `GpuTexelCopyTextureInfo`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn write_texture_with_buffer_source_and_u32_sequence( this: &GpuQueue, - destination: &GpuImageCopyTexture, + destination: &GpuTexelCopyTextureInfo, data: &::js_sys::Object, - data_layout: &GpuImageDataLayout, + data_layout: &GpuTexelCopyBufferLayout, size: &::wasm_bindgen::JsValue, - ); + ) -> Result<(), JsValue>; - # [wasm_bindgen (method , structural , js_class = "GPUQueue" , js_name = writeTexture)] + # [wasm_bindgen (catch , method , structural , js_class = "GPUQueue" , js_name = writeTexture)] #[doc = "The `writeTexture()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUQueue/writeTexture)"] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuImageCopyTexture`, `GpuImageDataLayout`, `GpuQueue`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuQueue`, `GpuTexelCopyBufferLayout`, `GpuTexelCopyTextureInfo`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn write_texture_with_u8_array_and_u32_sequence( + pub fn write_texture_with_u8_slice_and_u32_sequence( this: &GpuQueue, - destination: &GpuImageCopyTexture, + destination: &GpuTexelCopyTextureInfo, data: &[u8], - data_layout: &GpuImageDataLayout, + data_layout: &GpuTexelCopyBufferLayout, + size: &::wasm_bindgen::JsValue, + ) -> Result<(), JsValue>; + + # [wasm_bindgen (catch , method , structural , js_class = "GPUQueue" , js_name = writeTexture)] + #[doc = "The `writeTexture()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUQueue/writeTexture)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuQueue`, `GpuTexelCopyBufferLayout`, `GpuTexelCopyTextureInfo`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn write_texture_with_u8_array_and_u32_sequence( + this: &GpuQueue, + destination: &GpuTexelCopyTextureInfo, + data: &::js_sys::Uint8Array, + data_layout: &GpuTexelCopyBufferLayout, size: &::wasm_bindgen::JsValue, - ); + ) -> Result<(), JsValue>; - # [wasm_bindgen (method , structural , js_class = "GPUQueue" , js_name = writeTexture)] + # [wasm_bindgen (catch , method , structural , js_class = "GPUQueue" , js_name = writeTexture)] #[doc = "The `writeTexture()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUQueue/writeTexture)"] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuExtent3dDict`, `GpuImageCopyTexture`, `GpuImageDataLayout`, `GpuQueue`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuExtent3dDict`, `GpuQueue`, `GpuTexelCopyBufferLayout`, `GpuTexelCopyTextureInfo`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn write_texture_with_buffer_source_and_gpu_extent_3d_dict( this: &GpuQueue, - destination: &GpuImageCopyTexture, + destination: &GpuTexelCopyTextureInfo, data: &::js_sys::Object, - data_layout: &GpuImageDataLayout, + data_layout: &GpuTexelCopyBufferLayout, size: &GpuExtent3dDict, - ); + ) -> Result<(), JsValue>; - # [wasm_bindgen (method , structural , js_class = "GPUQueue" , js_name = writeTexture)] + # [wasm_bindgen (catch , method , structural , js_class = "GPUQueue" , js_name = writeTexture)] #[doc = "The `writeTexture()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUQueue/writeTexture)"] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuExtent3dDict`, `GpuImageCopyTexture`, `GpuImageDataLayout`, `GpuQueue`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuExtent3dDict`, `GpuQueue`, `GpuTexelCopyBufferLayout`, `GpuTexelCopyTextureInfo`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn write_texture_with_u8_array_and_gpu_extent_3d_dict( + pub fn write_texture_with_u8_slice_and_gpu_extent_3d_dict( this: &GpuQueue, - destination: &GpuImageCopyTexture, + destination: &GpuTexelCopyTextureInfo, data: &[u8], - data_layout: &GpuImageDataLayout, + data_layout: &GpuTexelCopyBufferLayout, + size: &GpuExtent3dDict, + ) -> Result<(), JsValue>; + + # [wasm_bindgen (catch , method , structural , js_class = "GPUQueue" , js_name = writeTexture)] + #[doc = "The `writeTexture()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUQueue/writeTexture)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuExtent3dDict`, `GpuQueue`, `GpuTexelCopyBufferLayout`, `GpuTexelCopyTextureInfo`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn write_texture_with_u8_array_and_gpu_extent_3d_dict( + this: &GpuQueue, + destination: &GpuTexelCopyTextureInfo, + data: &::js_sys::Uint8Array, + data_layout: &GpuTexelCopyBufferLayout, size: &GpuExtent3dDict, - ); + ) -> Result<(), JsValue>; } diff --git a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuQueueDescriptor.rs b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuQueueDescriptor.rs index 3224505d4e..e035547b4d 100644 --- a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuQueueDescriptor.rs +++ b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuQueueDescriptor.rs @@ -18,7 +18,7 @@ // // If you want to improve the generated code, please submit a PR to the https://github.com/rustwasm/wasm-bindgen repository. // -// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.91` command. +// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.97` command. #![allow(unused_imports)] #![allow(clippy::all)] use super::*; @@ -35,6 +35,24 @@ extern "C" { #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub type GpuQueueDescriptor; + + #[doc = "Get the `label` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuQueueDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "label")] + pub fn get_label(this: &GpuQueueDescriptor) -> Option<::alloc::string::String>; + + #[doc = "Change the `label` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuQueueDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "label")] + pub fn set_label(this: &GpuQueueDescriptor, val: &str); } impl GpuQueueDescriptor { @@ -50,20 +68,9 @@ impl GpuQueueDescriptor { ret } - #[doc = "Change the `label` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuQueueDescriptor`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[deprecated = "Use `set_label()` instead."] pub fn label(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("label"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_label(val); self } } diff --git a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuRenderBundle.rs b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuRenderBundle.rs index bab9c94107..704cc6e72f 100644 --- a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuRenderBundle.rs +++ b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuRenderBundle.rs @@ -18,7 +18,7 @@ // // If you want to improve the generated code, please submit a PR to the https://github.com/rustwasm/wasm-bindgen repository. // -// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.91` command. +// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.97` command. #![allow(unused_imports)] #![allow(clippy::all)] use super::*; @@ -47,7 +47,7 @@ extern "C" { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn label(this: &GpuRenderBundle) -> String; + pub fn label(this: &GpuRenderBundle) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "GPURenderBundle" , js_name = label)] #[doc = "Setter for the `label` field of this object."] diff --git a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuRenderBundleDescriptor.rs b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuRenderBundleDescriptor.rs index 0a73f47d04..2d471d2551 100644 --- a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuRenderBundleDescriptor.rs +++ b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuRenderBundleDescriptor.rs @@ -18,7 +18,7 @@ // // If you want to improve the generated code, please submit a PR to the https://github.com/rustwasm/wasm-bindgen repository. // -// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.91` command. +// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.97` command. #![allow(unused_imports)] #![allow(clippy::all)] use super::*; @@ -35,6 +35,24 @@ extern "C" { #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub type GpuRenderBundleDescriptor; + + #[doc = "Get the `label` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuRenderBundleDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "label")] + pub fn get_label(this: &GpuRenderBundleDescriptor) -> Option<::alloc::string::String>; + + #[doc = "Change the `label` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuRenderBundleDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "label")] + pub fn set_label(this: &GpuRenderBundleDescriptor, val: &str); } impl GpuRenderBundleDescriptor { @@ -50,20 +68,9 @@ impl GpuRenderBundleDescriptor { ret } - #[doc = "Change the `label` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuRenderBundleDescriptor`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[deprecated = "Use `set_label()` instead."] pub fn label(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("label"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_label(val); self } } diff --git a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuRenderBundleEncoder.rs b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuRenderBundleEncoder.rs index 0b8d2dde16..57ed468c74 100644 --- a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuRenderBundleEncoder.rs +++ b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuRenderBundleEncoder.rs @@ -18,7 +18,7 @@ // // If you want to improve the generated code, please submit a PR to the https://github.com/rustwasm/wasm-bindgen repository. // -// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.91` command. +// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.97` command. #![allow(unused_imports)] #![allow(clippy::all)] use super::*; @@ -47,7 +47,7 @@ extern "C" { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn label(this: &GpuRenderBundleEncoder) -> String; + pub fn label(this: &GpuRenderBundleEncoder) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "GPURenderBundleEncoder" , js_name = label)] #[doc = "Setter for the `label` field of this object."] @@ -116,7 +116,7 @@ extern "C" { dynamic_offsets: &::wasm_bindgen::JsValue, ); - # [wasm_bindgen (method , structural , js_class = "GPURenderBundleEncoder" , js_name = setBindGroup)] + # [wasm_bindgen (catch , method , structural , js_class = "GPURenderBundleEncoder" , js_name = setBindGroup)] #[doc = "The `setBindGroup()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPURenderBundleEncoder/setBindGroup)"] @@ -125,16 +125,16 @@ extern "C" { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn set_bind_group_with_u32_array_and_u32_and_dynamic_offsets_data_length( + pub fn set_bind_group_with_u32_slice_and_u32_and_dynamic_offsets_data_length( this: &GpuRenderBundleEncoder, index: u32, bind_group: Option<&GpuBindGroup>, dynamic_offsets_data: &[u32], dynamic_offsets_data_start: u32, dynamic_offsets_data_length: u32, - ); + ) -> Result<(), JsValue>; - # [wasm_bindgen (method , structural , js_class = "GPURenderBundleEncoder" , js_name = setBindGroup)] + # [wasm_bindgen (catch , method , structural , js_class = "GPURenderBundleEncoder" , js_name = setBindGroup)] #[doc = "The `setBindGroup()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPURenderBundleEncoder/setBindGroup)"] @@ -143,14 +143,50 @@ extern "C" { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn set_bind_group_with_u32_array_and_f64_and_dynamic_offsets_data_length( + pub fn set_bind_group_with_u32_array_and_u32_and_dynamic_offsets_data_length( + this: &GpuRenderBundleEncoder, + index: u32, + bind_group: Option<&GpuBindGroup>, + dynamic_offsets_data: &::js_sys::Uint32Array, + dynamic_offsets_data_start: u32, + dynamic_offsets_data_length: u32, + ) -> Result<(), JsValue>; + + # [wasm_bindgen (catch , method , structural , js_class = "GPURenderBundleEncoder" , js_name = setBindGroup)] + #[doc = "The `setBindGroup()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPURenderBundleEncoder/setBindGroup)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBindGroup`, `GpuRenderBundleEncoder`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn set_bind_group_with_u32_slice_and_f64_and_dynamic_offsets_data_length( this: &GpuRenderBundleEncoder, index: u32, bind_group: Option<&GpuBindGroup>, dynamic_offsets_data: &[u32], dynamic_offsets_data_start: f64, dynamic_offsets_data_length: u32, - ); + ) -> Result<(), JsValue>; + + # [wasm_bindgen (catch , method , structural , js_class = "GPURenderBundleEncoder" , js_name = setBindGroup)] + #[doc = "The `setBindGroup()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPURenderBundleEncoder/setBindGroup)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBindGroup`, `GpuRenderBundleEncoder`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn set_bind_group_with_u32_array_and_f64_and_dynamic_offsets_data_length( + this: &GpuRenderBundleEncoder, + index: u32, + bind_group: Option<&GpuBindGroup>, + dynamic_offsets_data: &::js_sys::Uint32Array, + dynamic_offsets_data_start: f64, + dynamic_offsets_data_length: u32, + ) -> Result<(), JsValue>; # [wasm_bindgen (method , structural , js_class = "GPURenderBundleEncoder" , js_name = insertDebugMarker)] #[doc = "The `insertDebugMarker()` method."] diff --git a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuRenderBundleEncoderDescriptor.rs b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuRenderBundleEncoderDescriptor.rs index 95bcc3d039..f093f66d22 100644 --- a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuRenderBundleEncoderDescriptor.rs +++ b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuRenderBundleEncoderDescriptor.rs @@ -18,7 +18,7 @@ // // If you want to improve the generated code, please submit a PR to the https://github.com/rustwasm/wasm-bindgen repository. // -// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.91` command. +// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.97` command. #![allow(unused_imports)] #![allow(clippy::all)] use super::*; @@ -35,21 +35,15 @@ extern "C" { #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub type GpuRenderBundleEncoderDescriptor; -} -impl GpuRenderBundleEncoderDescriptor { - #[doc = "Construct a new `GpuRenderBundleEncoderDescriptor`."] + #[doc = "Get the `label` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `GpuRenderBundleEncoderDescriptor`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn new(color_formats: &::wasm_bindgen::JsValue) -> Self { - #[allow(unused_mut)] - let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); - ret.color_formats(color_formats); - ret - } + #[wasm_bindgen(method, getter = "label")] + pub fn get_label(this: &GpuRenderBundleEncoderDescriptor) -> Option<::alloc::string::String>; #[doc = "Change the `label` field of this object."] #[doc = ""] @@ -57,16 +51,17 @@ impl GpuRenderBundleEncoderDescriptor { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn label(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("label"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "label")] + pub fn set_label(this: &GpuRenderBundleEncoderDescriptor, val: &str); + + #[doc = "Get the `colorFormats` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuRenderBundleEncoderDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "colorFormats")] + pub fn get_color_formats(this: &GpuRenderBundleEncoderDescriptor) -> ::js_sys::Array; #[doc = "Change the `colorFormats` field of this object."] #[doc = ""] @@ -74,20 +69,22 @@ impl GpuRenderBundleEncoderDescriptor { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn color_formats(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("colorFormats"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "colorFormats")] + pub fn set_color_formats( + this: &GpuRenderBundleEncoderDescriptor, + val: &::wasm_bindgen::JsValue, + ); + + #[doc = "Get the `depthStencilFormat` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuRenderBundleEncoderDescriptor`, `GpuTextureFormat`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "depthStencilFormat")] + pub fn get_depth_stencil_format( + this: &GpuRenderBundleEncoderDescriptor, + ) -> Option; #[doc = "Change the `depthStencilFormat` field of this object."] #[doc = ""] @@ -95,20 +92,17 @@ impl GpuRenderBundleEncoderDescriptor { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn depth_stencil_format(&mut self, val: GpuTextureFormat) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("depthStencilFormat"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "depthStencilFormat")] + pub fn set_depth_stencil_format(this: &GpuRenderBundleEncoderDescriptor, val: GpuTextureFormat); + + #[doc = "Get the `sampleCount` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuRenderBundleEncoderDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "sampleCount")] + pub fn get_sample_count(this: &GpuRenderBundleEncoderDescriptor) -> Option; #[doc = "Change the `sampleCount` field of this object."] #[doc = ""] @@ -116,20 +110,17 @@ impl GpuRenderBundleEncoderDescriptor { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn sample_count(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("sampleCount"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "sampleCount")] + pub fn set_sample_count(this: &GpuRenderBundleEncoderDescriptor, val: u32); + + #[doc = "Get the `depthReadOnly` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuRenderBundleEncoderDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "depthReadOnly")] + pub fn get_depth_read_only(this: &GpuRenderBundleEncoderDescriptor) -> Option; #[doc = "Change the `depthReadOnly` field of this object."] #[doc = ""] @@ -137,20 +128,17 @@ impl GpuRenderBundleEncoderDescriptor { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn depth_read_only(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("depthReadOnly"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "depthReadOnly")] + pub fn set_depth_read_only(this: &GpuRenderBundleEncoderDescriptor, val: bool); + + #[doc = "Get the `stencilReadOnly` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuRenderBundleEncoderDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "stencilReadOnly")] + pub fn get_stencil_read_only(this: &GpuRenderBundleEncoderDescriptor) -> Option; #[doc = "Change the `stencilReadOnly` field of this object."] #[doc = ""] @@ -158,18 +146,57 @@ impl GpuRenderBundleEncoderDescriptor { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "stencilReadOnly")] + pub fn set_stencil_read_only(this: &GpuRenderBundleEncoderDescriptor, val: bool); +} + +impl GpuRenderBundleEncoderDescriptor { + #[doc = "Construct a new `GpuRenderBundleEncoderDescriptor`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuRenderBundleEncoderDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new(color_formats: &::wasm_bindgen::JsValue) -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret.set_color_formats(color_formats); + ret + } + + #[deprecated = "Use `set_label()` instead."] + pub fn label(&mut self, val: &str) -> &mut Self { + self.set_label(val); + self + } + + #[deprecated = "Use `set_color_formats()` instead."] + pub fn color_formats(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { + self.set_color_formats(val); + self + } + + #[deprecated = "Use `set_depth_stencil_format()` instead."] + pub fn depth_stencil_format(&mut self, val: GpuTextureFormat) -> &mut Self { + self.set_depth_stencil_format(val); + self + } + + #[deprecated = "Use `set_sample_count()` instead."] + pub fn sample_count(&mut self, val: u32) -> &mut Self { + self.set_sample_count(val); + self + } + + #[deprecated = "Use `set_depth_read_only()` instead."] + pub fn depth_read_only(&mut self, val: bool) -> &mut Self { + self.set_depth_read_only(val); + self + } + + #[deprecated = "Use `set_stencil_read_only()` instead."] pub fn stencil_read_only(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("stencilReadOnly"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_stencil_read_only(val); self } } diff --git a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuRenderPassColorAttachment.rs b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuRenderPassColorAttachment.rs index 199d1400ec..3e2bdcf3cc 100644 --- a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuRenderPassColorAttachment.rs +++ b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuRenderPassColorAttachment.rs @@ -18,7 +18,7 @@ // // If you want to improve the generated code, please submit a PR to the https://github.com/rustwasm/wasm-bindgen repository. // -// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.91` command. +// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.97` command. #![allow(unused_imports)] #![allow(clippy::all)] use super::*; @@ -35,23 +35,15 @@ extern "C" { #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub type GpuRenderPassColorAttachment; -} -impl GpuRenderPassColorAttachment { - #[doc = "Construct a new `GpuRenderPassColorAttachment`."] + #[doc = "Get the `clearValue` field of this object."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuLoadOp`, `GpuRenderPassColorAttachment`, `GpuStoreOp`, `GpuTextureView`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuRenderPassColorAttachment`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn new(load_op: GpuLoadOp, store_op: GpuStoreOp, view: &GpuTextureView) -> Self { - #[allow(unused_mut)] - let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); - ret.load_op(load_op); - ret.store_op(store_op); - ret.view(view); - ret - } + #[wasm_bindgen(method, getter = "clearValue")] + pub fn get_clear_value(this: &GpuRenderPassColorAttachment) -> ::wasm_bindgen::JsValue; #[doc = "Change the `clearValue` field of this object."] #[doc = ""] @@ -59,20 +51,17 @@ impl GpuRenderPassColorAttachment { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn clear_value(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("clearValue"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "clearValue")] + pub fn set_clear_value(this: &GpuRenderPassColorAttachment, val: &::wasm_bindgen::JsValue); + + #[doc = "Get the `depthSlice` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuRenderPassColorAttachment`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "depthSlice")] + pub fn get_depth_slice(this: &GpuRenderPassColorAttachment) -> Option; #[doc = "Change the `depthSlice` field of this object."] #[doc = ""] @@ -80,20 +69,17 @@ impl GpuRenderPassColorAttachment { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn depth_slice(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("depthSlice"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "depthSlice")] + pub fn set_depth_slice(this: &GpuRenderPassColorAttachment, val: u32); + + #[doc = "Get the `loadOp` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuLoadOp`, `GpuRenderPassColorAttachment`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "loadOp")] + pub fn get_load_op(this: &GpuRenderPassColorAttachment) -> GpuLoadOp; #[doc = "Change the `loadOp` field of this object."] #[doc = ""] @@ -101,17 +87,17 @@ impl GpuRenderPassColorAttachment { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn load_op(&mut self, val: GpuLoadOp) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("loadOp"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "loadOp")] + pub fn set_load_op(this: &GpuRenderPassColorAttachment, val: GpuLoadOp); + + #[doc = "Get the `resolveTarget` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuRenderPassColorAttachment`, `GpuTextureView`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "resolveTarget")] + pub fn get_resolve_target(this: &GpuRenderPassColorAttachment) -> Option; #[doc = "Change the `resolveTarget` field of this object."] #[doc = ""] @@ -119,20 +105,17 @@ impl GpuRenderPassColorAttachment { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn resolve_target(&mut self, val: &GpuTextureView) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("resolveTarget"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "resolveTarget")] + pub fn set_resolve_target(this: &GpuRenderPassColorAttachment, val: &GpuTextureView); + + #[doc = "Get the `storeOp` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuRenderPassColorAttachment`, `GpuStoreOp`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "storeOp")] + pub fn get_store_op(this: &GpuRenderPassColorAttachment) -> GpuStoreOp; #[doc = "Change the `storeOp` field of this object."] #[doc = ""] @@ -140,20 +123,17 @@ impl GpuRenderPassColorAttachment { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn store_op(&mut self, val: GpuStoreOp) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("storeOp"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "storeOp")] + pub fn set_store_op(this: &GpuRenderPassColorAttachment, val: GpuStoreOp); + + #[doc = "Get the `view` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuRenderPassColorAttachment`, `GpuTextureView`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "view")] + pub fn get_view(this: &GpuRenderPassColorAttachment) -> GpuTextureView; #[doc = "Change the `view` field of this object."] #[doc = ""] @@ -161,14 +141,59 @@ impl GpuRenderPassColorAttachment { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "view")] + pub fn set_view(this: &GpuRenderPassColorAttachment, val: &GpuTextureView); +} + +impl GpuRenderPassColorAttachment { + #[doc = "Construct a new `GpuRenderPassColorAttachment`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuLoadOp`, `GpuRenderPassColorAttachment`, `GpuStoreOp`, `GpuTextureView`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new(load_op: GpuLoadOp, store_op: GpuStoreOp, view: &GpuTextureView) -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret.set_load_op(load_op); + ret.set_store_op(store_op); + ret.set_view(view); + ret + } + + #[deprecated = "Use `set_clear_value()` instead."] + pub fn clear_value(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { + self.set_clear_value(val); + self + } + + #[deprecated = "Use `set_depth_slice()` instead."] + pub fn depth_slice(&mut self, val: u32) -> &mut Self { + self.set_depth_slice(val); + self + } + + #[deprecated = "Use `set_load_op()` instead."] + pub fn load_op(&mut self, val: GpuLoadOp) -> &mut Self { + self.set_load_op(val); + self + } + + #[deprecated = "Use `set_resolve_target()` instead."] + pub fn resolve_target(&mut self, val: &GpuTextureView) -> &mut Self { + self.set_resolve_target(val); + self + } + + #[deprecated = "Use `set_store_op()` instead."] + pub fn store_op(&mut self, val: GpuStoreOp) -> &mut Self { + self.set_store_op(val); + self + } + + #[deprecated = "Use `set_view()` instead."] pub fn view(&mut self, val: &GpuTextureView) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("view"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_view(val); self } } diff --git a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuRenderPassDepthStencilAttachment.rs b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuRenderPassDepthStencilAttachment.rs index bccd742e01..7d945689d2 100644 --- a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuRenderPassDepthStencilAttachment.rs +++ b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuRenderPassDepthStencilAttachment.rs @@ -18,7 +18,7 @@ // // If you want to improve the generated code, please submit a PR to the https://github.com/rustwasm/wasm-bindgen repository. // -// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.91` command. +// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.97` command. #![allow(unused_imports)] #![allow(clippy::all)] use super::*; @@ -35,21 +35,15 @@ extern "C" { #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub type GpuRenderPassDepthStencilAttachment; -} -impl GpuRenderPassDepthStencilAttachment { - #[doc = "Construct a new `GpuRenderPassDepthStencilAttachment`."] + #[doc = "Get the `depthClearValue` field of this object."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuRenderPassDepthStencilAttachment`, `GpuTextureView`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuRenderPassDepthStencilAttachment`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn new(view: &GpuTextureView) -> Self { - #[allow(unused_mut)] - let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); - ret.view(view); - ret - } + #[wasm_bindgen(method, getter = "depthClearValue")] + pub fn get_depth_clear_value(this: &GpuRenderPassDepthStencilAttachment) -> Option; #[doc = "Change the `depthClearValue` field of this object."] #[doc = ""] @@ -57,20 +51,17 @@ impl GpuRenderPassDepthStencilAttachment { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn depth_clear_value(&mut self, val: f32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("depthClearValue"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "depthClearValue")] + pub fn set_depth_clear_value(this: &GpuRenderPassDepthStencilAttachment, val: f32); + + #[doc = "Get the `depthLoadOp` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuLoadOp`, `GpuRenderPassDepthStencilAttachment`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "depthLoadOp")] + pub fn get_depth_load_op(this: &GpuRenderPassDepthStencilAttachment) -> Option; #[doc = "Change the `depthLoadOp` field of this object."] #[doc = ""] @@ -78,20 +69,17 @@ impl GpuRenderPassDepthStencilAttachment { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn depth_load_op(&mut self, val: GpuLoadOp) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("depthLoadOp"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "depthLoadOp")] + pub fn set_depth_load_op(this: &GpuRenderPassDepthStencilAttachment, val: GpuLoadOp); + + #[doc = "Get the `depthReadOnly` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuRenderPassDepthStencilAttachment`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "depthReadOnly")] + pub fn get_depth_read_only(this: &GpuRenderPassDepthStencilAttachment) -> Option; #[doc = "Change the `depthReadOnly` field of this object."] #[doc = ""] @@ -99,20 +87,17 @@ impl GpuRenderPassDepthStencilAttachment { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn depth_read_only(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("depthReadOnly"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "depthReadOnly")] + pub fn set_depth_read_only(this: &GpuRenderPassDepthStencilAttachment, val: bool); + + #[doc = "Get the `depthStoreOp` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuRenderPassDepthStencilAttachment`, `GpuStoreOp`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "depthStoreOp")] + pub fn get_depth_store_op(this: &GpuRenderPassDepthStencilAttachment) -> Option; #[doc = "Change the `depthStoreOp` field of this object."] #[doc = ""] @@ -120,20 +105,17 @@ impl GpuRenderPassDepthStencilAttachment { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn depth_store_op(&mut self, val: GpuStoreOp) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("depthStoreOp"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "depthStoreOp")] + pub fn set_depth_store_op(this: &GpuRenderPassDepthStencilAttachment, val: GpuStoreOp); + + #[doc = "Get the `stencilClearValue` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuRenderPassDepthStencilAttachment`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "stencilClearValue")] + pub fn get_stencil_clear_value(this: &GpuRenderPassDepthStencilAttachment) -> Option; #[doc = "Change the `stencilClearValue` field of this object."] #[doc = ""] @@ -141,20 +123,17 @@ impl GpuRenderPassDepthStencilAttachment { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn stencil_clear_value(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("stencilClearValue"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "stencilClearValue")] + pub fn set_stencil_clear_value(this: &GpuRenderPassDepthStencilAttachment, val: u32); + + #[doc = "Get the `stencilLoadOp` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuLoadOp`, `GpuRenderPassDepthStencilAttachment`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "stencilLoadOp")] + pub fn get_stencil_load_op(this: &GpuRenderPassDepthStencilAttachment) -> Option; #[doc = "Change the `stencilLoadOp` field of this object."] #[doc = ""] @@ -162,20 +141,17 @@ impl GpuRenderPassDepthStencilAttachment { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn stencil_load_op(&mut self, val: GpuLoadOp) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("stencilLoadOp"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "stencilLoadOp")] + pub fn set_stencil_load_op(this: &GpuRenderPassDepthStencilAttachment, val: GpuLoadOp); + + #[doc = "Get the `stencilReadOnly` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuRenderPassDepthStencilAttachment`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "stencilReadOnly")] + pub fn get_stencil_read_only(this: &GpuRenderPassDepthStencilAttachment) -> Option; #[doc = "Change the `stencilReadOnly` field of this object."] #[doc = ""] @@ -183,20 +159,17 @@ impl GpuRenderPassDepthStencilAttachment { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn stencil_read_only(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("stencilReadOnly"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "stencilReadOnly")] + pub fn set_stencil_read_only(this: &GpuRenderPassDepthStencilAttachment, val: bool); + + #[doc = "Get the `stencilStoreOp` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuRenderPassDepthStencilAttachment`, `GpuStoreOp`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "stencilStoreOp")] + pub fn get_stencil_store_op(this: &GpuRenderPassDepthStencilAttachment) -> Option; #[doc = "Change the `stencilStoreOp` field of this object."] #[doc = ""] @@ -204,20 +177,17 @@ impl GpuRenderPassDepthStencilAttachment { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn stencil_store_op(&mut self, val: GpuStoreOp) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("stencilStoreOp"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "stencilStoreOp")] + pub fn set_stencil_store_op(this: &GpuRenderPassDepthStencilAttachment, val: GpuStoreOp); + + #[doc = "Get the `view` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuRenderPassDepthStencilAttachment`, `GpuTextureView`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "view")] + pub fn get_view(this: &GpuRenderPassDepthStencilAttachment) -> GpuTextureView; #[doc = "Change the `view` field of this object."] #[doc = ""] @@ -225,14 +195,75 @@ impl GpuRenderPassDepthStencilAttachment { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "view")] + pub fn set_view(this: &GpuRenderPassDepthStencilAttachment, val: &GpuTextureView); +} + +impl GpuRenderPassDepthStencilAttachment { + #[doc = "Construct a new `GpuRenderPassDepthStencilAttachment`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuRenderPassDepthStencilAttachment`, `GpuTextureView`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new(view: &GpuTextureView) -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret.set_view(view); + ret + } + + #[deprecated = "Use `set_depth_clear_value()` instead."] + pub fn depth_clear_value(&mut self, val: f32) -> &mut Self { + self.set_depth_clear_value(val); + self + } + + #[deprecated = "Use `set_depth_load_op()` instead."] + pub fn depth_load_op(&mut self, val: GpuLoadOp) -> &mut Self { + self.set_depth_load_op(val); + self + } + + #[deprecated = "Use `set_depth_read_only()` instead."] + pub fn depth_read_only(&mut self, val: bool) -> &mut Self { + self.set_depth_read_only(val); + self + } + + #[deprecated = "Use `set_depth_store_op()` instead."] + pub fn depth_store_op(&mut self, val: GpuStoreOp) -> &mut Self { + self.set_depth_store_op(val); + self + } + + #[deprecated = "Use `set_stencil_clear_value()` instead."] + pub fn stencil_clear_value(&mut self, val: u32) -> &mut Self { + self.set_stencil_clear_value(val); + self + } + + #[deprecated = "Use `set_stencil_load_op()` instead."] + pub fn stencil_load_op(&mut self, val: GpuLoadOp) -> &mut Self { + self.set_stencil_load_op(val); + self + } + + #[deprecated = "Use `set_stencil_read_only()` instead."] + pub fn stencil_read_only(&mut self, val: bool) -> &mut Self { + self.set_stencil_read_only(val); + self + } + + #[deprecated = "Use `set_stencil_store_op()` instead."] + pub fn stencil_store_op(&mut self, val: GpuStoreOp) -> &mut Self { + self.set_stencil_store_op(val); + self + } + + #[deprecated = "Use `set_view()` instead."] pub fn view(&mut self, val: &GpuTextureView) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("view"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_view(val); self } } diff --git a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuRenderPassDescriptor.rs b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuRenderPassDescriptor.rs index 3db05ace60..61d63faefa 100644 --- a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuRenderPassDescriptor.rs +++ b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuRenderPassDescriptor.rs @@ -18,7 +18,7 @@ // // If you want to improve the generated code, please submit a PR to the https://github.com/rustwasm/wasm-bindgen repository. // -// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.91` command. +// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.97` command. #![allow(unused_imports)] #![allow(clippy::all)] use super::*; @@ -35,21 +35,15 @@ extern "C" { #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub type GpuRenderPassDescriptor; -} -impl GpuRenderPassDescriptor { - #[doc = "Construct a new `GpuRenderPassDescriptor`."] + #[doc = "Get the `label` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `GpuRenderPassDescriptor`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn new(color_attachments: &::wasm_bindgen::JsValue) -> Self { - #[allow(unused_mut)] - let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); - ret.color_attachments(color_attachments); - ret - } + #[wasm_bindgen(method, getter = "label")] + pub fn get_label(this: &GpuRenderPassDescriptor) -> Option<::alloc::string::String>; #[doc = "Change the `label` field of this object."] #[doc = ""] @@ -57,16 +51,17 @@ impl GpuRenderPassDescriptor { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn label(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("label"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "label")] + pub fn set_label(this: &GpuRenderPassDescriptor, val: &str); + + #[doc = "Get the `colorAttachments` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuRenderPassDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "colorAttachments")] + pub fn get_color_attachments(this: &GpuRenderPassDescriptor) -> ::js_sys::Array; #[doc = "Change the `colorAttachments` field of this object."] #[doc = ""] @@ -74,20 +69,19 @@ impl GpuRenderPassDescriptor { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn color_attachments(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("colorAttachments"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "colorAttachments")] + pub fn set_color_attachments(this: &GpuRenderPassDescriptor, val: &::wasm_bindgen::JsValue); + + #[doc = "Get the `depthStencilAttachment` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuRenderPassDepthStencilAttachment`, `GpuRenderPassDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "depthStencilAttachment")] + pub fn get_depth_stencil_attachment( + this: &GpuRenderPassDescriptor, + ) -> Option; #[doc = "Change the `depthStencilAttachment` field of this object."] #[doc = ""] @@ -95,23 +89,20 @@ impl GpuRenderPassDescriptor { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn depth_stencil_attachment( - &mut self, + #[wasm_bindgen(method, setter = "depthStencilAttachment")] + pub fn set_depth_stencil_attachment( + this: &GpuRenderPassDescriptor, val: &GpuRenderPassDepthStencilAttachment, - ) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("depthStencilAttachment"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + ); + + #[doc = "Get the `maxDrawCount` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuRenderPassDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "maxDrawCount")] + pub fn get_max_draw_count(this: &GpuRenderPassDescriptor) -> Option; #[doc = "Change the `maxDrawCount` field of this object."] #[doc = ""] @@ -119,20 +110,17 @@ impl GpuRenderPassDescriptor { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn max_draw_count(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("maxDrawCount"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "maxDrawCount")] + pub fn set_max_draw_count(this: &GpuRenderPassDescriptor, val: f64); + + #[doc = "Get the `occlusionQuerySet` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuQuerySet`, `GpuRenderPassDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "occlusionQuerySet")] + pub fn get_occlusion_query_set(this: &GpuRenderPassDescriptor) -> Option; #[doc = "Change the `occlusionQuerySet` field of this object."] #[doc = ""] @@ -140,20 +128,19 @@ impl GpuRenderPassDescriptor { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn occlusion_query_set(&mut self, val: &GpuQuerySet) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("occlusionQuerySet"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "occlusionQuerySet")] + pub fn set_occlusion_query_set(this: &GpuRenderPassDescriptor, val: &GpuQuerySet); + + #[doc = "Get the `timestampWrites` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuRenderPassDescriptor`, `GpuRenderPassTimestampWrites`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "timestampWrites")] + pub fn get_timestamp_writes( + this: &GpuRenderPassDescriptor, + ) -> Option; #[doc = "Change the `timestampWrites` field of this object."] #[doc = ""] @@ -161,18 +148,60 @@ impl GpuRenderPassDescriptor { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "timestampWrites")] + pub fn set_timestamp_writes(this: &GpuRenderPassDescriptor, val: &GpuRenderPassTimestampWrites); +} + +impl GpuRenderPassDescriptor { + #[doc = "Construct a new `GpuRenderPassDescriptor`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuRenderPassDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new(color_attachments: &::wasm_bindgen::JsValue) -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret.set_color_attachments(color_attachments); + ret + } + + #[deprecated = "Use `set_label()` instead."] + pub fn label(&mut self, val: &str) -> &mut Self { + self.set_label(val); + self + } + + #[deprecated = "Use `set_color_attachments()` instead."] + pub fn color_attachments(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { + self.set_color_attachments(val); + self + } + + #[deprecated = "Use `set_depth_stencil_attachment()` instead."] + pub fn depth_stencil_attachment( + &mut self, + val: &GpuRenderPassDepthStencilAttachment, + ) -> &mut Self { + self.set_depth_stencil_attachment(val); + self + } + + #[deprecated = "Use `set_max_draw_count()` instead."] + pub fn max_draw_count(&mut self, val: f64) -> &mut Self { + self.set_max_draw_count(val); + self + } + + #[deprecated = "Use `set_occlusion_query_set()` instead."] + pub fn occlusion_query_set(&mut self, val: &GpuQuerySet) -> &mut Self { + self.set_occlusion_query_set(val); + self + } + + #[deprecated = "Use `set_timestamp_writes()` instead."] pub fn timestamp_writes(&mut self, val: &GpuRenderPassTimestampWrites) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("timestampWrites"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_timestamp_writes(val); self } } diff --git a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuRenderPassEncoder.rs b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuRenderPassEncoder.rs index 7a7726e21c..04f1812bf2 100644 --- a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuRenderPassEncoder.rs +++ b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuRenderPassEncoder.rs @@ -18,7 +18,7 @@ // // If you want to improve the generated code, please submit a PR to the https://github.com/rustwasm/wasm-bindgen repository. // -// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.91` command. +// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.97` command. #![allow(unused_imports)] #![allow(clippy::all)] use super::*; @@ -47,7 +47,7 @@ extern "C" { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn label(this: &GpuRenderPassEncoder) -> String; + pub fn label(this: &GpuRenderPassEncoder) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "GPURenderPassEncoder" , js_name = label)] #[doc = "Setter for the `label` field of this object."] @@ -104,7 +104,7 @@ extern "C" { #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn execute_bundles(this: &GpuRenderPassEncoder, bundles: &::wasm_bindgen::JsValue); - # [wasm_bindgen (method , structural , js_class = "GPURenderPassEncoder" , js_name = setBlendConstant)] + # [wasm_bindgen (catch , method , structural , js_class = "GPURenderPassEncoder" , js_name = setBlendConstant)] #[doc = "The `setBlendConstant()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPURenderPassEncoder/setBlendConstant)"] @@ -116,9 +116,9 @@ extern "C" { pub fn set_blend_constant_with_f64_sequence( this: &GpuRenderPassEncoder, color: &::wasm_bindgen::JsValue, - ); + ) -> Result<(), JsValue>; - # [wasm_bindgen (method , structural , js_class = "GPURenderPassEncoder" , js_name = setBlendConstant)] + # [wasm_bindgen (catch , method , structural , js_class = "GPURenderPassEncoder" , js_name = setBlendConstant)] #[doc = "The `setBlendConstant()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPURenderPassEncoder/setBlendConstant)"] @@ -130,7 +130,7 @@ extern "C" { pub fn set_blend_constant_with_gpu_color_dict( this: &GpuRenderPassEncoder, color: &GpuColorDict, - ); + ) -> Result<(), JsValue>; # [wasm_bindgen (method , structural , js_class = "GPURenderPassEncoder" , js_name = setScissorRect)] #[doc = "The `setScissorRect()` method."] @@ -204,7 +204,7 @@ extern "C" { dynamic_offsets: &::wasm_bindgen::JsValue, ); - # [wasm_bindgen (method , structural , js_class = "GPURenderPassEncoder" , js_name = setBindGroup)] + # [wasm_bindgen (catch , method , structural , js_class = "GPURenderPassEncoder" , js_name = setBindGroup)] #[doc = "The `setBindGroup()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPURenderPassEncoder/setBindGroup)"] @@ -213,16 +213,16 @@ extern "C" { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn set_bind_group_with_u32_array_and_u32_and_dynamic_offsets_data_length( + pub fn set_bind_group_with_u32_slice_and_u32_and_dynamic_offsets_data_length( this: &GpuRenderPassEncoder, index: u32, bind_group: Option<&GpuBindGroup>, dynamic_offsets_data: &[u32], dynamic_offsets_data_start: u32, dynamic_offsets_data_length: u32, - ); + ) -> Result<(), JsValue>; - # [wasm_bindgen (method , structural , js_class = "GPURenderPassEncoder" , js_name = setBindGroup)] + # [wasm_bindgen (catch , method , structural , js_class = "GPURenderPassEncoder" , js_name = setBindGroup)] #[doc = "The `setBindGroup()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPURenderPassEncoder/setBindGroup)"] @@ -231,14 +231,50 @@ extern "C" { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn set_bind_group_with_u32_array_and_f64_and_dynamic_offsets_data_length( + pub fn set_bind_group_with_u32_array_and_u32_and_dynamic_offsets_data_length( + this: &GpuRenderPassEncoder, + index: u32, + bind_group: Option<&GpuBindGroup>, + dynamic_offsets_data: &::js_sys::Uint32Array, + dynamic_offsets_data_start: u32, + dynamic_offsets_data_length: u32, + ) -> Result<(), JsValue>; + + # [wasm_bindgen (catch , method , structural , js_class = "GPURenderPassEncoder" , js_name = setBindGroup)] + #[doc = "The `setBindGroup()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPURenderPassEncoder/setBindGroup)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBindGroup`, `GpuRenderPassEncoder`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn set_bind_group_with_u32_slice_and_f64_and_dynamic_offsets_data_length( this: &GpuRenderPassEncoder, index: u32, bind_group: Option<&GpuBindGroup>, dynamic_offsets_data: &[u32], dynamic_offsets_data_start: f64, dynamic_offsets_data_length: u32, - ); + ) -> Result<(), JsValue>; + + # [wasm_bindgen (catch , method , structural , js_class = "GPURenderPassEncoder" , js_name = setBindGroup)] + #[doc = "The `setBindGroup()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPURenderPassEncoder/setBindGroup)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBindGroup`, `GpuRenderPassEncoder`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn set_bind_group_with_u32_array_and_f64_and_dynamic_offsets_data_length( + this: &GpuRenderPassEncoder, + index: u32, + bind_group: Option<&GpuBindGroup>, + dynamic_offsets_data: &::js_sys::Uint32Array, + dynamic_offsets_data_start: f64, + dynamic_offsets_data_length: u32, + ) -> Result<(), JsValue>; # [wasm_bindgen (method , structural , js_class = "GPURenderPassEncoder" , js_name = insertDebugMarker)] #[doc = "The `insertDebugMarker()` method."] diff --git a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuRenderPassTimestampWrites.rs b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuRenderPassTimestampWrites.rs index 42c1323db9..50de9a1e19 100644 --- a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuRenderPassTimestampWrites.rs +++ b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuRenderPassTimestampWrites.rs @@ -18,7 +18,7 @@ // // If you want to improve the generated code, please submit a PR to the https://github.com/rustwasm/wasm-bindgen repository. // -// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.91` command. +// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.97` command. #![allow(unused_imports)] #![allow(clippy::all)] use super::*; @@ -35,21 +35,15 @@ extern "C" { #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub type GpuRenderPassTimestampWrites; -} -impl GpuRenderPassTimestampWrites { - #[doc = "Construct a new `GpuRenderPassTimestampWrites`."] + #[doc = "Get the `beginningOfPassWriteIndex` field of this object."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuQuerySet`, `GpuRenderPassTimestampWrites`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuRenderPassTimestampWrites`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn new(query_set: &GpuQuerySet) -> Self { - #[allow(unused_mut)] - let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); - ret.query_set(query_set); - ret - } + #[wasm_bindgen(method, getter = "beginningOfPassWriteIndex")] + pub fn get_beginning_of_pass_write_index(this: &GpuRenderPassTimestampWrites) -> Option; #[doc = "Change the `beginningOfPassWriteIndex` field of this object."] #[doc = ""] @@ -57,20 +51,17 @@ impl GpuRenderPassTimestampWrites { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn beginning_of_pass_write_index(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("beginningOfPassWriteIndex"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "beginningOfPassWriteIndex")] + pub fn set_beginning_of_pass_write_index(this: &GpuRenderPassTimestampWrites, val: u32); + + #[doc = "Get the `endOfPassWriteIndex` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuRenderPassTimestampWrites`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "endOfPassWriteIndex")] + pub fn get_end_of_pass_write_index(this: &GpuRenderPassTimestampWrites) -> Option; #[doc = "Change the `endOfPassWriteIndex` field of this object."] #[doc = ""] @@ -78,20 +69,17 @@ impl GpuRenderPassTimestampWrites { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn end_of_pass_write_index(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("endOfPassWriteIndex"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "endOfPassWriteIndex")] + pub fn set_end_of_pass_write_index(this: &GpuRenderPassTimestampWrites, val: u32); + + #[doc = "Get the `querySet` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuQuerySet`, `GpuRenderPassTimestampWrites`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "querySet")] + pub fn get_query_set(this: &GpuRenderPassTimestampWrites) -> GpuQuerySet; #[doc = "Change the `querySet` field of this object."] #[doc = ""] @@ -99,18 +87,39 @@ impl GpuRenderPassTimestampWrites { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "querySet")] + pub fn set_query_set(this: &GpuRenderPassTimestampWrites, val: &GpuQuerySet); +} + +impl GpuRenderPassTimestampWrites { + #[doc = "Construct a new `GpuRenderPassTimestampWrites`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuQuerySet`, `GpuRenderPassTimestampWrites`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new(query_set: &GpuQuerySet) -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret.set_query_set(query_set); + ret + } + + #[deprecated = "Use `set_beginning_of_pass_write_index()` instead."] + pub fn beginning_of_pass_write_index(&mut self, val: u32) -> &mut Self { + self.set_beginning_of_pass_write_index(val); + self + } + + #[deprecated = "Use `set_end_of_pass_write_index()` instead."] + pub fn end_of_pass_write_index(&mut self, val: u32) -> &mut Self { + self.set_end_of_pass_write_index(val); + self + } + + #[deprecated = "Use `set_query_set()` instead."] pub fn query_set(&mut self, val: &GpuQuerySet) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("querySet"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_query_set(val); self } } diff --git a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuRenderPipeline.rs b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuRenderPipeline.rs index 709377d2ad..615aac5c9b 100644 --- a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuRenderPipeline.rs +++ b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuRenderPipeline.rs @@ -18,7 +18,7 @@ // // If you want to improve the generated code, please submit a PR to the https://github.com/rustwasm/wasm-bindgen repository. // -// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.91` command. +// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.97` command. #![allow(unused_imports)] #![allow(clippy::all)] use super::*; @@ -47,7 +47,7 @@ extern "C" { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn label(this: &GpuRenderPipeline) -> String; + pub fn label(this: &GpuRenderPipeline) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "GPURenderPipeline" , js_name = label)] #[doc = "Setter for the `label` field of this object."] diff --git a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuRenderPipelineDescriptor.rs b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuRenderPipelineDescriptor.rs index 9cede3cf79..c9e24c7783 100644 --- a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuRenderPipelineDescriptor.rs +++ b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuRenderPipelineDescriptor.rs @@ -18,7 +18,7 @@ // // If you want to improve the generated code, please submit a PR to the https://github.com/rustwasm/wasm-bindgen repository. // -// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.91` command. +// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.97` command. #![allow(unused_imports)] #![allow(clippy::all)] use super::*; @@ -35,22 +35,15 @@ extern "C" { #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub type GpuRenderPipelineDescriptor; -} -impl GpuRenderPipelineDescriptor { - #[doc = "Construct a new `GpuRenderPipelineDescriptor`."] + #[doc = "Get the `label` field of this object."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuRenderPipelineDescriptor`, `GpuVertexState`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuRenderPipelineDescriptor`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn new(layout: &::wasm_bindgen::JsValue, vertex: &GpuVertexState) -> Self { - #[allow(unused_mut)] - let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); - ret.layout(layout); - ret.vertex(vertex); - ret - } + #[wasm_bindgen(method, getter = "label")] + pub fn get_label(this: &GpuRenderPipelineDescriptor) -> Option<::alloc::string::String>; #[doc = "Change the `label` field of this object."] #[doc = ""] @@ -58,16 +51,17 @@ impl GpuRenderPipelineDescriptor { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn label(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("label"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "label")] + pub fn set_label(this: &GpuRenderPipelineDescriptor, val: &str); + + #[doc = "Get the `layout` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuRenderPipelineDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "layout")] + pub fn get_layout(this: &GpuRenderPipelineDescriptor) -> ::wasm_bindgen::JsValue; #[doc = "Change the `layout` field of this object."] #[doc = ""] @@ -75,17 +69,17 @@ impl GpuRenderPipelineDescriptor { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn layout(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("layout"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "layout")] + pub fn set_layout(this: &GpuRenderPipelineDescriptor, val: &::wasm_bindgen::JsValue); + + #[doc = "Get the `depthStencil` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuDepthStencilState`, `GpuRenderPipelineDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "depthStencil")] + pub fn get_depth_stencil(this: &GpuRenderPipelineDescriptor) -> Option; #[doc = "Change the `depthStencil` field of this object."] #[doc = ""] @@ -93,20 +87,17 @@ impl GpuRenderPipelineDescriptor { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn depth_stencil(&mut self, val: &GpuDepthStencilState) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("depthStencil"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "depthStencil")] + pub fn set_depth_stencil(this: &GpuRenderPipelineDescriptor, val: &GpuDepthStencilState); + + #[doc = "Get the `fragment` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuFragmentState`, `GpuRenderPipelineDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "fragment")] + pub fn get_fragment(this: &GpuRenderPipelineDescriptor) -> Option; #[doc = "Change the `fragment` field of this object."] #[doc = ""] @@ -114,20 +105,17 @@ impl GpuRenderPipelineDescriptor { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn fragment(&mut self, val: &GpuFragmentState) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("fragment"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "fragment")] + pub fn set_fragment(this: &GpuRenderPipelineDescriptor, val: &GpuFragmentState); + + #[doc = "Get the `multisample` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuMultisampleState`, `GpuRenderPipelineDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "multisample")] + pub fn get_multisample(this: &GpuRenderPipelineDescriptor) -> Option; #[doc = "Change the `multisample` field of this object."] #[doc = ""] @@ -135,20 +123,17 @@ impl GpuRenderPipelineDescriptor { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn multisample(&mut self, val: &GpuMultisampleState) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("multisample"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "multisample")] + pub fn set_multisample(this: &GpuRenderPipelineDescriptor, val: &GpuMultisampleState); + + #[doc = "Get the `primitive` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuPrimitiveState`, `GpuRenderPipelineDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "primitive")] + pub fn get_primitive(this: &GpuRenderPipelineDescriptor) -> Option; #[doc = "Change the `primitive` field of this object."] #[doc = ""] @@ -156,20 +141,17 @@ impl GpuRenderPipelineDescriptor { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn primitive(&mut self, val: &GpuPrimitiveState) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("primitive"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "primitive")] + pub fn set_primitive(this: &GpuRenderPipelineDescriptor, val: &GpuPrimitiveState); + + #[doc = "Get the `vertex` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuRenderPipelineDescriptor`, `GpuVertexState`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "vertex")] + pub fn get_vertex(this: &GpuRenderPipelineDescriptor) -> GpuVertexState; #[doc = "Change the `vertex` field of this object."] #[doc = ""] @@ -177,15 +159,64 @@ impl GpuRenderPipelineDescriptor { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "vertex")] + pub fn set_vertex(this: &GpuRenderPipelineDescriptor, val: &GpuVertexState); +} + +impl GpuRenderPipelineDescriptor { + #[doc = "Construct a new `GpuRenderPipelineDescriptor`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuRenderPipelineDescriptor`, `GpuVertexState`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new(layout: &::wasm_bindgen::JsValue, vertex: &GpuVertexState) -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret.set_layout(layout); + ret.set_vertex(vertex); + ret + } + + #[deprecated = "Use `set_label()` instead."] + pub fn label(&mut self, val: &str) -> &mut Self { + self.set_label(val); + self + } + + #[deprecated = "Use `set_layout()` instead."] + pub fn layout(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { + self.set_layout(val); + self + } + + #[deprecated = "Use `set_depth_stencil()` instead."] + pub fn depth_stencil(&mut self, val: &GpuDepthStencilState) -> &mut Self { + self.set_depth_stencil(val); + self + } + + #[deprecated = "Use `set_fragment()` instead."] + pub fn fragment(&mut self, val: &GpuFragmentState) -> &mut Self { + self.set_fragment(val); + self + } + + #[deprecated = "Use `set_multisample()` instead."] + pub fn multisample(&mut self, val: &GpuMultisampleState) -> &mut Self { + self.set_multisample(val); + self + } + + #[deprecated = "Use `set_primitive()` instead."] + pub fn primitive(&mut self, val: &GpuPrimitiveState) -> &mut Self { + self.set_primitive(val); + self + } + + #[deprecated = "Use `set_vertex()` instead."] pub fn vertex(&mut self, val: &GpuVertexState) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("vertex"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_vertex(val); self } } diff --git a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuRequestAdapterOptions.rs b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuRequestAdapterOptions.rs index 5189fd6f4a..22ab89df63 100644 --- a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuRequestAdapterOptions.rs +++ b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuRequestAdapterOptions.rs @@ -18,7 +18,7 @@ // // If you want to improve the generated code, please submit a PR to the https://github.com/rustwasm/wasm-bindgen repository. // -// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.91` command. +// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.97` command. #![allow(unused_imports)] #![allow(clippy::all)] use super::*; @@ -35,20 +35,33 @@ extern "C" { #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub type GpuRequestAdapterOptions; -} -impl GpuRequestAdapterOptions { - #[doc = "Construct a new `GpuRequestAdapterOptions`."] + #[doc = "Get the `featureLevel` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `GpuRequestAdapterOptions`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn new() -> Self { - #[allow(unused_mut)] - let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); - ret - } + #[wasm_bindgen(method, getter = "featureLevel")] + pub fn get_feature_level(this: &GpuRequestAdapterOptions) -> Option<::alloc::string::String>; + + #[doc = "Change the `featureLevel` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuRequestAdapterOptions`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "featureLevel")] + pub fn set_feature_level(this: &GpuRequestAdapterOptions, val: &str); + + #[doc = "Get the `forceFallbackAdapter` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuRequestAdapterOptions`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "forceFallbackAdapter")] + pub fn get_force_fallback_adapter(this: &GpuRequestAdapterOptions) -> Option; #[doc = "Change the `forceFallbackAdapter` field of this object."] #[doc = ""] @@ -56,20 +69,17 @@ impl GpuRequestAdapterOptions { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn force_fallback_adapter(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("forceFallbackAdapter"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "forceFallbackAdapter")] + pub fn set_force_fallback_adapter(this: &GpuRequestAdapterOptions, val: bool); + + #[doc = "Get the `powerPreference` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuPowerPreference`, `GpuRequestAdapterOptions`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "powerPreference")] + pub fn get_power_preference(this: &GpuRequestAdapterOptions) -> Option; #[doc = "Change the `powerPreference` field of this object."] #[doc = ""] @@ -77,18 +87,62 @@ impl GpuRequestAdapterOptions { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "powerPreference")] + pub fn set_power_preference(this: &GpuRequestAdapterOptions, val: GpuPowerPreference); + + #[doc = "Get the `xrCompatible` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuRequestAdapterOptions`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "xrCompatible")] + pub fn get_xr_compatible(this: &GpuRequestAdapterOptions) -> Option; + + #[doc = "Change the `xrCompatible` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuRequestAdapterOptions`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "xrCompatible")] + pub fn set_xr_compatible(this: &GpuRequestAdapterOptions, val: bool); +} + +impl GpuRequestAdapterOptions { + #[doc = "Construct a new `GpuRequestAdapterOptions`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuRequestAdapterOptions`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new() -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret + } + + #[deprecated = "Use `set_feature_level()` instead."] + pub fn feature_level(&mut self, val: &str) -> &mut Self { + self.set_feature_level(val); + self + } + + #[deprecated = "Use `set_force_fallback_adapter()` instead."] + pub fn force_fallback_adapter(&mut self, val: bool) -> &mut Self { + self.set_force_fallback_adapter(val); + self + } + + #[deprecated = "Use `set_power_preference()` instead."] pub fn power_preference(&mut self, val: GpuPowerPreference) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("powerPreference"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_power_preference(val); + self + } + + #[deprecated = "Use `set_xr_compatible()` instead."] + pub fn xr_compatible(&mut self, val: bool) -> &mut Self { + self.set_xr_compatible(val); self } } diff --git a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuSampler.rs b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuSampler.rs index eb00f2534d..4ec4f604b2 100644 --- a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuSampler.rs +++ b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuSampler.rs @@ -18,7 +18,7 @@ // // If you want to improve the generated code, please submit a PR to the https://github.com/rustwasm/wasm-bindgen repository. // -// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.91` command. +// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.97` command. #![allow(unused_imports)] #![allow(clippy::all)] use super::*; @@ -47,7 +47,7 @@ extern "C" { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn label(this: &GpuSampler) -> String; + pub fn label(this: &GpuSampler) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "GPUSampler" , js_name = label)] #[doc = "Setter for the `label` field of this object."] diff --git a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuSamplerBindingLayout.rs b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuSamplerBindingLayout.rs index 00d8e856b2..2a6852d3f7 100644 --- a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuSamplerBindingLayout.rs +++ b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuSamplerBindingLayout.rs @@ -18,7 +18,7 @@ // // If you want to improve the generated code, please submit a PR to the https://github.com/rustwasm/wasm-bindgen repository. // -// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.91` command. +// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.97` command. #![allow(unused_imports)] #![allow(clippy::all)] use super::*; @@ -35,6 +35,24 @@ extern "C" { #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub type GpuSamplerBindingLayout; + + #[doc = "Get the `type` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuSamplerBindingLayout`, `GpuSamplerBindingType`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "type")] + pub fn get_type(this: &GpuSamplerBindingLayout) -> Option; + + #[doc = "Change the `type` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuSamplerBindingLayout`, `GpuSamplerBindingType`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "type")] + pub fn set_type(this: &GpuSamplerBindingLayout, val: GpuSamplerBindingType); } impl GpuSamplerBindingLayout { @@ -50,20 +68,9 @@ impl GpuSamplerBindingLayout { ret } - #[doc = "Change the `type` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuSamplerBindingLayout`, `GpuSamplerBindingType`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[deprecated = "Use `set_type()` instead."] pub fn type_(&mut self, val: GpuSamplerBindingType) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("type"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_type(val); self } } diff --git a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuSamplerBindingType.rs b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuSamplerBindingType.rs index 7c361589cf..11d87ff082 100644 --- a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuSamplerBindingType.rs +++ b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuSamplerBindingType.rs @@ -18,7 +18,7 @@ // // If you want to improve the generated code, please submit a PR to the https://github.com/rustwasm/wasm-bindgen repository. // -// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.91` command. +// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.97` command. #![allow(unused_imports)] #![allow(clippy::all)] use wasm_bindgen::prelude::*; diff --git a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuSamplerDescriptor.rs b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuSamplerDescriptor.rs index 7c8f0d4381..49998661fa 100644 --- a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuSamplerDescriptor.rs +++ b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuSamplerDescriptor.rs @@ -18,7 +18,7 @@ // // If you want to improve the generated code, please submit a PR to the https://github.com/rustwasm/wasm-bindgen repository. // -// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.91` command. +// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.97` command. #![allow(unused_imports)] #![allow(clippy::all)] use super::*; @@ -35,20 +35,15 @@ extern "C" { #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub type GpuSamplerDescriptor; -} -impl GpuSamplerDescriptor { - #[doc = "Construct a new `GpuSamplerDescriptor`."] + #[doc = "Get the `label` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `GpuSamplerDescriptor`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn new() -> Self { - #[allow(unused_mut)] - let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); - ret - } + #[wasm_bindgen(method, getter = "label")] + pub fn get_label(this: &GpuSamplerDescriptor) -> Option<::alloc::string::String>; #[doc = "Change the `label` field of this object."] #[doc = ""] @@ -56,16 +51,17 @@ impl GpuSamplerDescriptor { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn label(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("label"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "label")] + pub fn set_label(this: &GpuSamplerDescriptor, val: &str); + + #[doc = "Get the `addressModeU` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuAddressMode`, `GpuSamplerDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "addressModeU")] + pub fn get_address_mode_u(this: &GpuSamplerDescriptor) -> Option; #[doc = "Change the `addressModeU` field of this object."] #[doc = ""] @@ -73,20 +69,17 @@ impl GpuSamplerDescriptor { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn address_mode_u(&mut self, val: GpuAddressMode) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("addressModeU"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "addressModeU")] + pub fn set_address_mode_u(this: &GpuSamplerDescriptor, val: GpuAddressMode); + + #[doc = "Get the `addressModeV` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuAddressMode`, `GpuSamplerDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "addressModeV")] + pub fn get_address_mode_v(this: &GpuSamplerDescriptor) -> Option; #[doc = "Change the `addressModeV` field of this object."] #[doc = ""] @@ -94,20 +87,17 @@ impl GpuSamplerDescriptor { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn address_mode_v(&mut self, val: GpuAddressMode) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("addressModeV"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "addressModeV")] + pub fn set_address_mode_v(this: &GpuSamplerDescriptor, val: GpuAddressMode); + + #[doc = "Get the `addressModeW` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuAddressMode`, `GpuSamplerDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "addressModeW")] + pub fn get_address_mode_w(this: &GpuSamplerDescriptor) -> Option; #[doc = "Change the `addressModeW` field of this object."] #[doc = ""] @@ -115,20 +105,17 @@ impl GpuSamplerDescriptor { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn address_mode_w(&mut self, val: GpuAddressMode) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("addressModeW"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "addressModeW")] + pub fn set_address_mode_w(this: &GpuSamplerDescriptor, val: GpuAddressMode); + + #[doc = "Get the `compare` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuCompareFunction`, `GpuSamplerDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "compare")] + pub fn get_compare(this: &GpuSamplerDescriptor) -> Option; #[doc = "Change the `compare` field of this object."] #[doc = ""] @@ -136,20 +123,17 @@ impl GpuSamplerDescriptor { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn compare(&mut self, val: GpuCompareFunction) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("compare"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "compare")] + pub fn set_compare(this: &GpuSamplerDescriptor, val: GpuCompareFunction); + + #[doc = "Get the `lodMaxClamp` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuSamplerDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "lodMaxClamp")] + pub fn get_lod_max_clamp(this: &GpuSamplerDescriptor) -> Option; #[doc = "Change the `lodMaxClamp` field of this object."] #[doc = ""] @@ -157,20 +141,17 @@ impl GpuSamplerDescriptor { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn lod_max_clamp(&mut self, val: f32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("lodMaxClamp"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "lodMaxClamp")] + pub fn set_lod_max_clamp(this: &GpuSamplerDescriptor, val: f32); + + #[doc = "Get the `lodMinClamp` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuSamplerDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "lodMinClamp")] + pub fn get_lod_min_clamp(this: &GpuSamplerDescriptor) -> Option; #[doc = "Change the `lodMinClamp` field of this object."] #[doc = ""] @@ -178,20 +159,17 @@ impl GpuSamplerDescriptor { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn lod_min_clamp(&mut self, val: f32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("lodMinClamp"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "lodMinClamp")] + pub fn set_lod_min_clamp(this: &GpuSamplerDescriptor, val: f32); + + #[doc = "Get the `magFilter` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuFilterMode`, `GpuSamplerDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "magFilter")] + pub fn get_mag_filter(this: &GpuSamplerDescriptor) -> Option; #[doc = "Change the `magFilter` field of this object."] #[doc = ""] @@ -199,20 +177,17 @@ impl GpuSamplerDescriptor { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn mag_filter(&mut self, val: GpuFilterMode) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("magFilter"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "magFilter")] + pub fn set_mag_filter(this: &GpuSamplerDescriptor, val: GpuFilterMode); + + #[doc = "Get the `maxAnisotropy` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuSamplerDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "maxAnisotropy")] + pub fn get_max_anisotropy(this: &GpuSamplerDescriptor) -> Option; #[doc = "Change the `maxAnisotropy` field of this object."] #[doc = ""] @@ -220,20 +195,17 @@ impl GpuSamplerDescriptor { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn max_anisotropy(&mut self, val: u16) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("maxAnisotropy"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "maxAnisotropy")] + pub fn set_max_anisotropy(this: &GpuSamplerDescriptor, val: u16); + + #[doc = "Get the `minFilter` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuFilterMode`, `GpuSamplerDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "minFilter")] + pub fn get_min_filter(this: &GpuSamplerDescriptor) -> Option; #[doc = "Change the `minFilter` field of this object."] #[doc = ""] @@ -241,20 +213,17 @@ impl GpuSamplerDescriptor { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn min_filter(&mut self, val: GpuFilterMode) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("minFilter"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "minFilter")] + pub fn set_min_filter(this: &GpuSamplerDescriptor, val: GpuFilterMode); + + #[doc = "Get the `mipmapFilter` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuMipmapFilterMode`, `GpuSamplerDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "mipmapFilter")] + pub fn get_mipmap_filter(this: &GpuSamplerDescriptor) -> Option; #[doc = "Change the `mipmapFilter` field of this object."] #[doc = ""] @@ -262,18 +231,86 @@ impl GpuSamplerDescriptor { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "mipmapFilter")] + pub fn set_mipmap_filter(this: &GpuSamplerDescriptor, val: GpuMipmapFilterMode); +} + +impl GpuSamplerDescriptor { + #[doc = "Construct a new `GpuSamplerDescriptor`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuSamplerDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new() -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret + } + + #[deprecated = "Use `set_label()` instead."] + pub fn label(&mut self, val: &str) -> &mut Self { + self.set_label(val); + self + } + + #[deprecated = "Use `set_address_mode_u()` instead."] + pub fn address_mode_u(&mut self, val: GpuAddressMode) -> &mut Self { + self.set_address_mode_u(val); + self + } + + #[deprecated = "Use `set_address_mode_v()` instead."] + pub fn address_mode_v(&mut self, val: GpuAddressMode) -> &mut Self { + self.set_address_mode_v(val); + self + } + + #[deprecated = "Use `set_address_mode_w()` instead."] + pub fn address_mode_w(&mut self, val: GpuAddressMode) -> &mut Self { + self.set_address_mode_w(val); + self + } + + #[deprecated = "Use `set_compare()` instead."] + pub fn compare(&mut self, val: GpuCompareFunction) -> &mut Self { + self.set_compare(val); + self + } + + #[deprecated = "Use `set_lod_max_clamp()` instead."] + pub fn lod_max_clamp(&mut self, val: f32) -> &mut Self { + self.set_lod_max_clamp(val); + self + } + + #[deprecated = "Use `set_lod_min_clamp()` instead."] + pub fn lod_min_clamp(&mut self, val: f32) -> &mut Self { + self.set_lod_min_clamp(val); + self + } + + #[deprecated = "Use `set_mag_filter()` instead."] + pub fn mag_filter(&mut self, val: GpuFilterMode) -> &mut Self { + self.set_mag_filter(val); + self + } + + #[deprecated = "Use `set_max_anisotropy()` instead."] + pub fn max_anisotropy(&mut self, val: u16) -> &mut Self { + self.set_max_anisotropy(val); + self + } + + #[deprecated = "Use `set_min_filter()` instead."] + pub fn min_filter(&mut self, val: GpuFilterMode) -> &mut Self { + self.set_min_filter(val); + self + } + + #[deprecated = "Use `set_mipmap_filter()` instead."] pub fn mipmap_filter(&mut self, val: GpuMipmapFilterMode) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("mipmapFilter"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_mipmap_filter(val); self } } diff --git a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuShaderModule.rs b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuShaderModule.rs index 9148feb25b..033d1e4dee 100644 --- a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuShaderModule.rs +++ b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuShaderModule.rs @@ -18,7 +18,7 @@ // // If you want to improve the generated code, please submit a PR to the https://github.com/rustwasm/wasm-bindgen repository. // -// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.91` command. +// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.97` command. #![allow(unused_imports)] #![allow(clippy::all)] use super::*; @@ -47,7 +47,7 @@ extern "C" { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn label(this: &GpuShaderModule) -> String; + pub fn label(this: &GpuShaderModule) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "GPUShaderModule" , js_name = label)] #[doc = "Setter for the `label` field of this object."] diff --git a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuShaderModuleDescriptor.rs b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuShaderModuleDescriptor.rs index 3823a3dcf8..526bcce191 100644 --- a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuShaderModuleDescriptor.rs +++ b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuShaderModuleDescriptor.rs @@ -18,7 +18,7 @@ // // If you want to improve the generated code, please submit a PR to the https://github.com/rustwasm/wasm-bindgen repository. // -// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.91` command. +// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.97` command. #![allow(unused_imports)] #![allow(clippy::all)] use super::*; @@ -35,21 +35,15 @@ extern "C" { #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub type GpuShaderModuleDescriptor; -} -impl GpuShaderModuleDescriptor { - #[doc = "Construct a new `GpuShaderModuleDescriptor`."] + #[doc = "Get the `label` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `GpuShaderModuleDescriptor`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn new(code: &str) -> Self { - #[allow(unused_mut)] - let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); - ret.code(code); - ret - } + #[wasm_bindgen(method, getter = "label")] + pub fn get_label(this: &GpuShaderModuleDescriptor) -> Option<::alloc::string::String>; #[doc = "Change the `label` field of this object."] #[doc = ""] @@ -57,16 +51,17 @@ impl GpuShaderModuleDescriptor { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn label(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("label"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "label")] + pub fn set_label(this: &GpuShaderModuleDescriptor, val: &str); + + #[doc = "Get the `code` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuShaderModuleDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "code")] + pub fn get_code(this: &GpuShaderModuleDescriptor) -> ::alloc::string::String; #[doc = "Change the `code` field of this object."] #[doc = ""] @@ -74,16 +69,17 @@ impl GpuShaderModuleDescriptor { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn code(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("code"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "code")] + pub fn set_code(this: &GpuShaderModuleDescriptor, val: &str); + + #[doc = "Get the `compilationHints` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuShaderModuleDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "compilationHints")] + pub fn get_compilation_hints(this: &GpuShaderModuleDescriptor) -> Option<::js_sys::Array>; #[doc = "Change the `compilationHints` field of this object."] #[doc = ""] @@ -91,39 +87,39 @@ impl GpuShaderModuleDescriptor { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn compilation_hints(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("compilationHints"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "compilationHints")] + pub fn set_compilation_hints(this: &GpuShaderModuleDescriptor, val: &::wasm_bindgen::JsValue); +} - #[doc = "Change the `sourceMap` field of this object."] +impl GpuShaderModuleDescriptor { + #[doc = "Construct a new `GpuShaderModuleDescriptor`."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `GpuShaderModuleDescriptor`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn source_map(&mut self, val: &::js_sys::Object) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("sourceMap"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + pub fn new(code: &str) -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret.set_code(code); + ret + } + + #[deprecated = "Use `set_label()` instead."] + pub fn label(&mut self, val: &str) -> &mut Self { + self.set_label(val); + self + } + + #[deprecated = "Use `set_code()` instead."] + pub fn code(&mut self, val: &str) -> &mut Self { + self.set_code(val); + self + } + + #[deprecated = "Use `set_compilation_hints()` instead."] + pub fn compilation_hints(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { + self.set_compilation_hints(val); self } } diff --git a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuStencilFaceState.rs b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuStencilFaceState.rs index b0f324a0eb..7af7f1c1f6 100644 --- a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuStencilFaceState.rs +++ b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuStencilFaceState.rs @@ -18,7 +18,7 @@ // // If you want to improve the generated code, please submit a PR to the https://github.com/rustwasm/wasm-bindgen repository. // -// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.91` command. +// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.97` command. #![allow(unused_imports)] #![allow(clippy::all)] use super::*; @@ -35,20 +35,15 @@ extern "C" { #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub type GpuStencilFaceState; -} -impl GpuStencilFaceState { - #[doc = "Construct a new `GpuStencilFaceState`."] + #[doc = "Get the `compare` field of this object."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuStencilFaceState`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuCompareFunction`, `GpuStencilFaceState`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn new() -> Self { - #[allow(unused_mut)] - let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); - ret - } + #[wasm_bindgen(method, getter = "compare")] + pub fn get_compare(this: &GpuStencilFaceState) -> Option; #[doc = "Change the `compare` field of this object."] #[doc = ""] @@ -56,20 +51,17 @@ impl GpuStencilFaceState { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn compare(&mut self, val: GpuCompareFunction) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("compare"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "compare")] + pub fn set_compare(this: &GpuStencilFaceState, val: GpuCompareFunction); + + #[doc = "Get the `depthFailOp` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuStencilFaceState`, `GpuStencilOperation`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "depthFailOp")] + pub fn get_depth_fail_op(this: &GpuStencilFaceState) -> Option; #[doc = "Change the `depthFailOp` field of this object."] #[doc = ""] @@ -77,20 +69,17 @@ impl GpuStencilFaceState { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn depth_fail_op(&mut self, val: GpuStencilOperation) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("depthFailOp"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "depthFailOp")] + pub fn set_depth_fail_op(this: &GpuStencilFaceState, val: GpuStencilOperation); + + #[doc = "Get the `failOp` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuStencilFaceState`, `GpuStencilOperation`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "failOp")] + pub fn get_fail_op(this: &GpuStencilFaceState) -> Option; #[doc = "Change the `failOp` field of this object."] #[doc = ""] @@ -98,17 +87,17 @@ impl GpuStencilFaceState { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn fail_op(&mut self, val: GpuStencilOperation) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("failOp"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "failOp")] + pub fn set_fail_op(this: &GpuStencilFaceState, val: GpuStencilOperation); + + #[doc = "Get the `passOp` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuStencilFaceState`, `GpuStencilOperation`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "passOp")] + pub fn get_pass_op(this: &GpuStencilFaceState) -> Option; #[doc = "Change the `passOp` field of this object."] #[doc = ""] @@ -116,15 +105,44 @@ impl GpuStencilFaceState { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "passOp")] + pub fn set_pass_op(this: &GpuStencilFaceState, val: GpuStencilOperation); +} + +impl GpuStencilFaceState { + #[doc = "Construct a new `GpuStencilFaceState`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuStencilFaceState`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new() -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret + } + + #[deprecated = "Use `set_compare()` instead."] + pub fn compare(&mut self, val: GpuCompareFunction) -> &mut Self { + self.set_compare(val); + self + } + + #[deprecated = "Use `set_depth_fail_op()` instead."] + pub fn depth_fail_op(&mut self, val: GpuStencilOperation) -> &mut Self { + self.set_depth_fail_op(val); + self + } + + #[deprecated = "Use `set_fail_op()` instead."] + pub fn fail_op(&mut self, val: GpuStencilOperation) -> &mut Self { + self.set_fail_op(val); + self + } + + #[deprecated = "Use `set_pass_op()` instead."] pub fn pass_op(&mut self, val: GpuStencilOperation) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("passOp"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_pass_op(val); self } } diff --git a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuStencilOperation.rs b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuStencilOperation.rs index 72895124f8..858794c04f 100644 --- a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuStencilOperation.rs +++ b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuStencilOperation.rs @@ -18,7 +18,7 @@ // // If you want to improve the generated code, please submit a PR to the https://github.com/rustwasm/wasm-bindgen repository. // -// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.91` command. +// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.97` command. #![allow(unused_imports)] #![allow(clippy::all)] use wasm_bindgen::prelude::*; diff --git a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuStorageTextureAccess.rs b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuStorageTextureAccess.rs index c017b48b19..6bd5b14f2a 100644 --- a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuStorageTextureAccess.rs +++ b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuStorageTextureAccess.rs @@ -18,7 +18,7 @@ // // If you want to improve the generated code, please submit a PR to the https://github.com/rustwasm/wasm-bindgen repository. // -// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.91` command. +// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.97` command. #![allow(unused_imports)] #![allow(clippy::all)] use wasm_bindgen::prelude::*; diff --git a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuStorageTextureBindingLayout.rs b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuStorageTextureBindingLayout.rs index f9b27b5333..093bcd6bec 100644 --- a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuStorageTextureBindingLayout.rs +++ b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuStorageTextureBindingLayout.rs @@ -18,7 +18,7 @@ // // If you want to improve the generated code, please submit a PR to the https://github.com/rustwasm/wasm-bindgen repository. // -// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.91` command. +// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.97` command. #![allow(unused_imports)] #![allow(clippy::all)] use super::*; @@ -35,21 +35,15 @@ extern "C" { #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub type GpuStorageTextureBindingLayout; -} -impl GpuStorageTextureBindingLayout { - #[doc = "Construct a new `GpuStorageTextureBindingLayout`."] + #[doc = "Get the `access` field of this object."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuStorageTextureBindingLayout`, `GpuTextureFormat`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuStorageTextureAccess`, `GpuStorageTextureBindingLayout`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn new(format: GpuTextureFormat) -> Self { - #[allow(unused_mut)] - let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); - ret.format(format); - ret - } + #[wasm_bindgen(method, getter = "access")] + pub fn get_access(this: &GpuStorageTextureBindingLayout) -> Option; #[doc = "Change the `access` field of this object."] #[doc = ""] @@ -57,17 +51,17 @@ impl GpuStorageTextureBindingLayout { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn access(&mut self, val: GpuStorageTextureAccess) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("access"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "access")] + pub fn set_access(this: &GpuStorageTextureBindingLayout, val: GpuStorageTextureAccess); + + #[doc = "Get the `format` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuStorageTextureBindingLayout`, `GpuTextureFormat`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "format")] + pub fn get_format(this: &GpuStorageTextureBindingLayout) -> GpuTextureFormat; #[doc = "Change the `format` field of this object."] #[doc = ""] @@ -75,17 +69,19 @@ impl GpuStorageTextureBindingLayout { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn format(&mut self, val: GpuTextureFormat) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("format"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "format")] + pub fn set_format(this: &GpuStorageTextureBindingLayout, val: GpuTextureFormat); + + #[doc = "Get the `viewDimension` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuStorageTextureBindingLayout`, `GpuTextureViewDimension`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "viewDimension")] + pub fn get_view_dimension( + this: &GpuStorageTextureBindingLayout, + ) -> Option; #[doc = "Change the `viewDimension` field of this object."] #[doc = ""] @@ -93,18 +89,39 @@ impl GpuStorageTextureBindingLayout { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "viewDimension")] + pub fn set_view_dimension(this: &GpuStorageTextureBindingLayout, val: GpuTextureViewDimension); +} + +impl GpuStorageTextureBindingLayout { + #[doc = "Construct a new `GpuStorageTextureBindingLayout`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuStorageTextureBindingLayout`, `GpuTextureFormat`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new(format: GpuTextureFormat) -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret.set_format(format); + ret + } + + #[deprecated = "Use `set_access()` instead."] + pub fn access(&mut self, val: GpuStorageTextureAccess) -> &mut Self { + self.set_access(val); + self + } + + #[deprecated = "Use `set_format()` instead."] + pub fn format(&mut self, val: GpuTextureFormat) -> &mut Self { + self.set_format(val); + self + } + + #[deprecated = "Use `set_view_dimension()` instead."] pub fn view_dimension(&mut self, val: GpuTextureViewDimension) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("viewDimension"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_view_dimension(val); self } } diff --git a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuStoreOp.rs b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuStoreOp.rs index 7af64ec61e..7206c4ba78 100644 --- a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuStoreOp.rs +++ b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuStoreOp.rs @@ -18,7 +18,7 @@ // // If you want to improve the generated code, please submit a PR to the https://github.com/rustwasm/wasm-bindgen repository. // -// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.91` command. +// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.97` command. #![allow(unused_imports)] #![allow(clippy::all)] use wasm_bindgen::prelude::*; diff --git a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuSupportedFeatures.rs b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuSupportedFeatures.rs index 8304ea9864..1f3843beea 100644 --- a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuSupportedFeatures.rs +++ b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuSupportedFeatures.rs @@ -18,7 +18,7 @@ // // If you want to improve the generated code, please submit a PR to the https://github.com/rustwasm/wasm-bindgen repository. // -// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.91` command. +// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.97` command. #![allow(unused_imports)] #![allow(clippy::all)] use super::*; diff --git a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuSupportedLimits.rs b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuSupportedLimits.rs index 0bd278ebea..1cdaa1e638 100644 --- a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuSupportedLimits.rs +++ b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuSupportedLimits.rs @@ -18,7 +18,7 @@ // // If you want to improve the generated code, please submit a PR to the https://github.com/rustwasm/wasm-bindgen repository. // -// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.91` command. +// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.97` command. #![allow(unused_imports)] #![allow(clippy::all)] use super::*; @@ -280,17 +280,6 @@ extern "C" { #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn max_vertex_buffer_array_stride(this: &GpuSupportedLimits) -> u32; - # [wasm_bindgen (structural , method , getter , js_class = "GPUSupportedLimits" , js_name = maxInterStageShaderComponents)] - #[doc = "Getter for the `maxInterStageShaderComponents` field of this object."] - #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUSupportedLimits/maxInterStageShaderComponents)"] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuSupportedLimits`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn max_inter_stage_shader_components(this: &GpuSupportedLimits) -> u32; - # [wasm_bindgen (structural , method , getter , js_class = "GPUSupportedLimits" , js_name = maxInterStageShaderVariables)] #[doc = "Getter for the `maxInterStageShaderVariables` field of this object."] #[doc = ""] diff --git a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuTexelCopyBufferInfo.rs b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuTexelCopyBufferInfo.rs new file mode 100644 index 0000000000..28a794a64b --- /dev/null +++ b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuTexelCopyBufferInfo.rs @@ -0,0 +1,149 @@ +// DO NOT EDIT THIS FILE! +// +// This module part of a subset of web-sys that is used by wgpu's webgpu backend. +// +// These bindings are vendored into wgpu for the sole purpose of letting +// us pin the WebGPU backend to a specific version of the bindings, not +// to enable local changes. There are no provisions to preserve changes +// you make here the next time we re-vendor the bindings. +// +// The `web-sys` crate does not treat breaking changes to the WebGPU API +// as semver breaking changes, as WebGPU is "unstable". This means Cargo +// will not let us mix versions of `web-sys`, pinning WebGPU bindings to +// a specific version, while letting other bindings like WebGL get +// updated. Vendoring WebGPU was the workaround we chose. +// +// Vendoring also allows us to avoid building `web-sys` with +// `--cfg=web_sys_unstable_apis`, needed to get the WebGPU bindings. +// +// If you want to improve the generated code, please submit a PR to the https://github.com/rustwasm/wasm-bindgen repository. +// +// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.97` command. +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; + +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = GPUTexelCopyBufferInfo)] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `GpuTexelCopyBufferInfo` dictionary."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuTexelCopyBufferInfo`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub type GpuTexelCopyBufferInfo; + + #[doc = "Get the `bytesPerRow` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuTexelCopyBufferInfo`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "bytesPerRow")] + pub fn get_bytes_per_row(this: &GpuTexelCopyBufferInfo) -> Option; + + #[doc = "Change the `bytesPerRow` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuTexelCopyBufferInfo`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "bytesPerRow")] + pub fn set_bytes_per_row(this: &GpuTexelCopyBufferInfo, val: u32); + + #[doc = "Get the `offset` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuTexelCopyBufferInfo`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "offset")] + pub fn get_offset(this: &GpuTexelCopyBufferInfo) -> Option; + + #[doc = "Change the `offset` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuTexelCopyBufferInfo`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "offset")] + pub fn set_offset(this: &GpuTexelCopyBufferInfo, val: f64); + + #[doc = "Get the `rowsPerImage` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuTexelCopyBufferInfo`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "rowsPerImage")] + pub fn get_rows_per_image(this: &GpuTexelCopyBufferInfo) -> Option; + + #[doc = "Change the `rowsPerImage` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuTexelCopyBufferInfo`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "rowsPerImage")] + pub fn set_rows_per_image(this: &GpuTexelCopyBufferInfo, val: u32); + + #[doc = "Get the `buffer` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBuffer`, `GpuTexelCopyBufferInfo`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "buffer")] + pub fn get_buffer(this: &GpuTexelCopyBufferInfo) -> GpuBuffer; + + #[doc = "Change the `buffer` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBuffer`, `GpuTexelCopyBufferInfo`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "buffer")] + pub fn set_buffer(this: &GpuTexelCopyBufferInfo, val: &GpuBuffer); +} + +impl GpuTexelCopyBufferInfo { + #[doc = "Construct a new `GpuTexelCopyBufferInfo`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBuffer`, `GpuTexelCopyBufferInfo`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new(buffer: &GpuBuffer) -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret.set_buffer(buffer); + ret + } + + #[deprecated = "Use `set_bytes_per_row()` instead."] + pub fn bytes_per_row(&mut self, val: u32) -> &mut Self { + self.set_bytes_per_row(val); + self + } + + #[deprecated = "Use `set_offset()` instead."] + pub fn offset(&mut self, val: f64) -> &mut Self { + self.set_offset(val); + self + } + + #[deprecated = "Use `set_rows_per_image()` instead."] + pub fn rows_per_image(&mut self, val: u32) -> &mut Self { + self.set_rows_per_image(val); + self + } + + #[deprecated = "Use `set_buffer()` instead."] + pub fn buffer(&mut self, val: &GpuBuffer) -> &mut Self { + self.set_buffer(val); + self + } +} diff --git a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuImageCopyBuffer.rs b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuTexelCopyBufferLayout.rs similarity index 59% rename from wgpu/src/backend/webgpu/webgpu_sys/gen_GpuImageCopyBuffer.rs rename to wgpu/src/backend/webgpu/webgpu_sys/gen_GpuTexelCopyBufferLayout.rs index b9a8ca5bf3..32459bf15c 100644 --- a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuImageCopyBuffer.rs +++ b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuTexelCopyBufferLayout.rs @@ -18,7 +18,7 @@ // // If you want to improve the generated code, please submit a PR to the https://github.com/rustwasm/wasm-bindgen repository. // -// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.91` command. +// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.97` command. #![allow(unused_imports)] #![allow(clippy::all)] use super::*; @@ -26,106 +26,105 @@ use wasm_bindgen::prelude::*; #[wasm_bindgen] extern "C" { - # [wasm_bindgen (extends = :: js_sys :: Object , js_name = GPUImageCopyBuffer)] + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = GPUTexelCopyBufferLayout)] #[derive(Debug, Clone, PartialEq, Eq)] - #[doc = "The `GpuImageCopyBuffer` dictionary."] + #[doc = "The `GpuTexelCopyBufferLayout` dictionary."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuImageCopyBuffer`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuTexelCopyBufferLayout`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub type GpuImageCopyBuffer; -} + pub type GpuTexelCopyBufferLayout; -impl GpuImageCopyBuffer { - #[doc = "Construct a new `GpuImageCopyBuffer`."] + #[doc = "Get the `bytesPerRow` field of this object."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuBuffer`, `GpuImageCopyBuffer`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuTexelCopyBufferLayout`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn new(buffer: &GpuBuffer) -> Self { - #[allow(unused_mut)] - let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); - ret.buffer(buffer); - ret - } + #[wasm_bindgen(method, getter = "bytesPerRow")] + pub fn get_bytes_per_row(this: &GpuTexelCopyBufferLayout) -> Option; #[doc = "Change the `bytesPerRow` field of this object."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuImageCopyBuffer`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuTexelCopyBufferLayout`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn bytes_per_row(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("bytesPerRow"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "bytesPerRow")] + pub fn set_bytes_per_row(this: &GpuTexelCopyBufferLayout, val: u32); + + #[doc = "Get the `offset` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuTexelCopyBufferLayout`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "offset")] + pub fn get_offset(this: &GpuTexelCopyBufferLayout) -> Option; #[doc = "Change the `offset` field of this object."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuImageCopyBuffer`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuTexelCopyBufferLayout`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn offset(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("offset"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "offset")] + pub fn set_offset(this: &GpuTexelCopyBufferLayout, val: f64); + + #[doc = "Get the `rowsPerImage` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuTexelCopyBufferLayout`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "rowsPerImage")] + pub fn get_rows_per_image(this: &GpuTexelCopyBufferLayout) -> Option; #[doc = "Change the `rowsPerImage` field of this object."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuImageCopyBuffer`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuTexelCopyBufferLayout`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn rows_per_image(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("rowsPerImage"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "rowsPerImage")] + pub fn set_rows_per_image(this: &GpuTexelCopyBufferLayout, val: u32); +} - #[doc = "Change the `buffer` field of this object."] +impl GpuTexelCopyBufferLayout { + #[doc = "Construct a new `GpuTexelCopyBufferLayout`."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuBuffer`, `GpuImageCopyBuffer`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuTexelCopyBufferLayout`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn buffer(&mut self, val: &GpuBuffer) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("buffer"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + pub fn new() -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret + } + + #[deprecated = "Use `set_bytes_per_row()` instead."] + pub fn bytes_per_row(&mut self, val: u32) -> &mut Self { + self.set_bytes_per_row(val); self } + + #[deprecated = "Use `set_offset()` instead."] + pub fn offset(&mut self, val: f64) -> &mut Self { + self.set_offset(val); + self + } + + #[deprecated = "Use `set_rows_per_image()` instead."] + pub fn rows_per_image(&mut self, val: u32) -> &mut Self { + self.set_rows_per_image(val); + self + } +} + +impl Default for GpuTexelCopyBufferLayout { + fn default() -> Self { + Self::new() + } } diff --git a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuImageCopyTexture.rs b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuTexelCopyTextureInfo.rs similarity index 52% rename from wgpu/src/backend/webgpu/webgpu_sys/gen_GpuImageCopyTexture.rs rename to wgpu/src/backend/webgpu/webgpu_sys/gen_GpuTexelCopyTextureInfo.rs index 15fe41c2db..c02bc48e36 100644 --- a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuImageCopyTexture.rs +++ b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuTexelCopyTextureInfo.rs @@ -18,7 +18,7 @@ // // If you want to improve the generated code, please submit a PR to the https://github.com/rustwasm/wasm-bindgen repository. // -// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.91` command. +// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.97` command. #![allow(unused_imports)] #![allow(clippy::all)] use super::*; @@ -26,106 +26,124 @@ use wasm_bindgen::prelude::*; #[wasm_bindgen] extern "C" { - # [wasm_bindgen (extends = :: js_sys :: Object , js_name = GPUImageCopyTexture)] + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = GPUTexelCopyTextureInfo)] #[derive(Debug, Clone, PartialEq, Eq)] - #[doc = "The `GpuImageCopyTexture` dictionary."] + #[doc = "The `GpuTexelCopyTextureInfo` dictionary."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuImageCopyTexture`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuTexelCopyTextureInfo`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub type GpuImageCopyTexture; -} + pub type GpuTexelCopyTextureInfo; -impl GpuImageCopyTexture { - #[doc = "Construct a new `GpuImageCopyTexture`."] + #[doc = "Get the `aspect` field of this object."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuImageCopyTexture`, `GpuTexture`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuTexelCopyTextureInfo`, `GpuTextureAspect`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn new(texture: &GpuTexture) -> Self { - #[allow(unused_mut)] - let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); - ret.texture(texture); - ret - } + #[wasm_bindgen(method, getter = "aspect")] + pub fn get_aspect(this: &GpuTexelCopyTextureInfo) -> Option; #[doc = "Change the `aspect` field of this object."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuImageCopyTexture`, `GpuTextureAspect`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuTexelCopyTextureInfo`, `GpuTextureAspect`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn aspect(&mut self, val: GpuTextureAspect) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("aspect"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "aspect")] + pub fn set_aspect(this: &GpuTexelCopyTextureInfo, val: GpuTextureAspect); + + #[doc = "Get the `mipLevel` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuTexelCopyTextureInfo`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "mipLevel")] + pub fn get_mip_level(this: &GpuTexelCopyTextureInfo) -> Option; #[doc = "Change the `mipLevel` field of this object."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuImageCopyTexture`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuTexelCopyTextureInfo`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn mip_level(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("mipLevel"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "mipLevel")] + pub fn set_mip_level(this: &GpuTexelCopyTextureInfo, val: u32); + + #[doc = "Get the `origin` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuTexelCopyTextureInfo`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "origin")] + pub fn get_origin(this: &GpuTexelCopyTextureInfo) -> ::wasm_bindgen::JsValue; #[doc = "Change the `origin` field of this object."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuImageCopyTexture`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuTexelCopyTextureInfo`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn origin(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("origin"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "origin")] + pub fn set_origin(this: &GpuTexelCopyTextureInfo, val: &::wasm_bindgen::JsValue); + + #[doc = "Get the `texture` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuTexelCopyTextureInfo`, `GpuTexture`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "texture")] + pub fn get_texture(this: &GpuTexelCopyTextureInfo) -> GpuTexture; #[doc = "Change the `texture` field of this object."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuImageCopyTexture`, `GpuTexture`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuTexelCopyTextureInfo`, `GpuTexture`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "texture")] + pub fn set_texture(this: &GpuTexelCopyTextureInfo, val: &GpuTexture); +} + +impl GpuTexelCopyTextureInfo { + #[doc = "Construct a new `GpuTexelCopyTextureInfo`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuTexelCopyTextureInfo`, `GpuTexture`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new(texture: &GpuTexture) -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret.set_texture(texture); + ret + } + + #[deprecated = "Use `set_aspect()` instead."] + pub fn aspect(&mut self, val: GpuTextureAspect) -> &mut Self { + self.set_aspect(val); + self + } + + #[deprecated = "Use `set_mip_level()` instead."] + pub fn mip_level(&mut self, val: u32) -> &mut Self { + self.set_mip_level(val); + self + } + + #[deprecated = "Use `set_origin()` instead."] + pub fn origin(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { + self.set_origin(val); + self + } + + #[deprecated = "Use `set_texture()` instead."] pub fn texture(&mut self, val: &GpuTexture) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("texture"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_texture(val); self } } diff --git a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuTexture.rs b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuTexture.rs index 231025a65f..50437cc1e7 100644 --- a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuTexture.rs +++ b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuTexture.rs @@ -18,7 +18,7 @@ // // If you want to improve the generated code, please submit a PR to the https://github.com/rustwasm/wasm-bindgen repository. // -// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.91` command. +// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.97` command. #![allow(unused_imports)] #![allow(clippy::all)] use super::*; @@ -135,7 +135,7 @@ extern "C" { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn label(this: &GpuTexture) -> String; + pub fn label(this: &GpuTexture) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "GPUTexture" , js_name = label)] #[doc = "Setter for the `label` field of this object."] @@ -148,7 +148,7 @@ extern "C" { #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn set_label(this: &GpuTexture, value: &str); - # [wasm_bindgen (method , structural , js_class = "GPUTexture" , js_name = createView)] + # [wasm_bindgen (catch , method , structural , js_class = "GPUTexture" , js_name = createView)] #[doc = "The `createView()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUTexture/createView)"] @@ -157,9 +157,9 @@ extern "C" { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn create_view(this: &GpuTexture) -> GpuTextureView; + pub fn create_view(this: &GpuTexture) -> Result; - # [wasm_bindgen (method , structural , js_class = "GPUTexture" , js_name = createView)] + # [wasm_bindgen (catch , method , structural , js_class = "GPUTexture" , js_name = createView)] #[doc = "The `createView()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUTexture/createView)"] @@ -171,7 +171,7 @@ extern "C" { pub fn create_view_with_descriptor( this: &GpuTexture, descriptor: &GpuTextureViewDescriptor, - ) -> GpuTextureView; + ) -> Result; # [wasm_bindgen (method , structural , js_class = "GPUTexture" , js_name = destroy)] #[doc = "The `destroy()` method."] diff --git a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuTextureAspect.rs b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuTextureAspect.rs index fe5bebbef9..b4e485939b 100644 --- a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuTextureAspect.rs +++ b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuTextureAspect.rs @@ -18,7 +18,7 @@ // // If you want to improve the generated code, please submit a PR to the https://github.com/rustwasm/wasm-bindgen repository. // -// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.91` command. +// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.97` command. #![allow(unused_imports)] #![allow(clippy::all)] use wasm_bindgen::prelude::*; diff --git a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuTextureBindingLayout.rs b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuTextureBindingLayout.rs index 385cb2d3ac..cd71dd32bf 100644 --- a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuTextureBindingLayout.rs +++ b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuTextureBindingLayout.rs @@ -18,7 +18,7 @@ // // If you want to improve the generated code, please submit a PR to the https://github.com/rustwasm/wasm-bindgen repository. // -// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.91` command. +// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.97` command. #![allow(unused_imports)] #![allow(clippy::all)] use super::*; @@ -35,20 +35,15 @@ extern "C" { #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub type GpuTextureBindingLayout; -} -impl GpuTextureBindingLayout { - #[doc = "Construct a new `GpuTextureBindingLayout`."] + #[doc = "Get the `multisampled` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `GpuTextureBindingLayout`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn new() -> Self { - #[allow(unused_mut)] - let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); - ret - } + #[wasm_bindgen(method, getter = "multisampled")] + pub fn get_multisampled(this: &GpuTextureBindingLayout) -> Option; #[doc = "Change the `multisampled` field of this object."] #[doc = ""] @@ -56,20 +51,17 @@ impl GpuTextureBindingLayout { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn multisampled(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("multisampled"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "multisampled")] + pub fn set_multisampled(this: &GpuTextureBindingLayout, val: bool); + + #[doc = "Get the `sampleType` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuTextureBindingLayout`, `GpuTextureSampleType`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "sampleType")] + pub fn get_sample_type(this: &GpuTextureBindingLayout) -> Option; #[doc = "Change the `sampleType` field of this object."] #[doc = ""] @@ -77,20 +69,17 @@ impl GpuTextureBindingLayout { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn sample_type(&mut self, val: GpuTextureSampleType) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("sampleType"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "sampleType")] + pub fn set_sample_type(this: &GpuTextureBindingLayout, val: GpuTextureSampleType); + + #[doc = "Get the `viewDimension` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuTextureBindingLayout`, `GpuTextureViewDimension`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "viewDimension")] + pub fn get_view_dimension(this: &GpuTextureBindingLayout) -> Option; #[doc = "Change the `viewDimension` field of this object."] #[doc = ""] @@ -98,18 +87,38 @@ impl GpuTextureBindingLayout { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "viewDimension")] + pub fn set_view_dimension(this: &GpuTextureBindingLayout, val: GpuTextureViewDimension); +} + +impl GpuTextureBindingLayout { + #[doc = "Construct a new `GpuTextureBindingLayout`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuTextureBindingLayout`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new() -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret + } + + #[deprecated = "Use `set_multisampled()` instead."] + pub fn multisampled(&mut self, val: bool) -> &mut Self { + self.set_multisampled(val); + self + } + + #[deprecated = "Use `set_sample_type()` instead."] + pub fn sample_type(&mut self, val: GpuTextureSampleType) -> &mut Self { + self.set_sample_type(val); + self + } + + #[deprecated = "Use `set_view_dimension()` instead."] pub fn view_dimension(&mut self, val: GpuTextureViewDimension) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("viewDimension"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_view_dimension(val); self } } diff --git a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuTextureDescriptor.rs b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuTextureDescriptor.rs index 909072d848..4ddbba8c3c 100644 --- a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuTextureDescriptor.rs +++ b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuTextureDescriptor.rs @@ -18,7 +18,7 @@ // // If you want to improve the generated code, please submit a PR to the https://github.com/rustwasm/wasm-bindgen repository. // -// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.91` command. +// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.97` command. #![allow(unused_imports)] #![allow(clippy::all)] use super::*; @@ -35,23 +35,15 @@ extern "C" { #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub type GpuTextureDescriptor; -} -impl GpuTextureDescriptor { - #[doc = "Construct a new `GpuTextureDescriptor`."] + #[doc = "Get the `label` field of this object."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuTextureDescriptor`, `GpuTextureFormat`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuTextureDescriptor`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn new(format: GpuTextureFormat, size: &::wasm_bindgen::JsValue, usage: u32) -> Self { - #[allow(unused_mut)] - let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); - ret.format(format); - ret.size(size); - ret.usage(usage); - ret - } + #[wasm_bindgen(method, getter = "label")] + pub fn get_label(this: &GpuTextureDescriptor) -> Option<::alloc::string::String>; #[doc = "Change the `label` field of this object."] #[doc = ""] @@ -59,16 +51,17 @@ impl GpuTextureDescriptor { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn label(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("label"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "label")] + pub fn set_label(this: &GpuTextureDescriptor, val: &str); + + #[doc = "Get the `dimension` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuTextureDescriptor`, `GpuTextureDimension`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "dimension")] + pub fn get_dimension(this: &GpuTextureDescriptor) -> Option; #[doc = "Change the `dimension` field of this object."] #[doc = ""] @@ -76,20 +69,17 @@ impl GpuTextureDescriptor { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn dimension(&mut self, val: GpuTextureDimension) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("dimension"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "dimension")] + pub fn set_dimension(this: &GpuTextureDescriptor, val: GpuTextureDimension); + + #[doc = "Get the `format` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuTextureDescriptor`, `GpuTextureFormat`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "format")] + pub fn get_format(this: &GpuTextureDescriptor) -> GpuTextureFormat; #[doc = "Change the `format` field of this object."] #[doc = ""] @@ -97,17 +87,17 @@ impl GpuTextureDescriptor { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn format(&mut self, val: GpuTextureFormat) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("format"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "format")] + pub fn set_format(this: &GpuTextureDescriptor, val: GpuTextureFormat); + + #[doc = "Get the `mipLevelCount` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuTextureDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "mipLevelCount")] + pub fn get_mip_level_count(this: &GpuTextureDescriptor) -> Option; #[doc = "Change the `mipLevelCount` field of this object."] #[doc = ""] @@ -115,20 +105,17 @@ impl GpuTextureDescriptor { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn mip_level_count(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("mipLevelCount"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "mipLevelCount")] + pub fn set_mip_level_count(this: &GpuTextureDescriptor, val: u32); + + #[doc = "Get the `sampleCount` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuTextureDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "sampleCount")] + pub fn get_sample_count(this: &GpuTextureDescriptor) -> Option; #[doc = "Change the `sampleCount` field of this object."] #[doc = ""] @@ -136,20 +123,17 @@ impl GpuTextureDescriptor { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn sample_count(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("sampleCount"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "sampleCount")] + pub fn set_sample_count(this: &GpuTextureDescriptor, val: u32); + + #[doc = "Get the `size` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuTextureDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "size")] + pub fn get_size(this: &GpuTextureDescriptor) -> ::wasm_bindgen::JsValue; #[doc = "Change the `size` field of this object."] #[doc = ""] @@ -157,16 +141,17 @@ impl GpuTextureDescriptor { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn size(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("size"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "size")] + pub fn set_size(this: &GpuTextureDescriptor, val: &::wasm_bindgen::JsValue); + + #[doc = "Get the `usage` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuTextureDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "usage")] + pub fn get_usage(this: &GpuTextureDescriptor) -> u32; #[doc = "Change the `usage` field of this object."] #[doc = ""] @@ -174,16 +159,17 @@ impl GpuTextureDescriptor { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn usage(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("usage"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "usage")] + pub fn set_usage(this: &GpuTextureDescriptor, val: u32); + + #[doc = "Get the `viewFormats` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuTextureDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "viewFormats")] + pub fn get_view_formats(this: &GpuTextureDescriptor) -> Option<::js_sys::Array>; #[doc = "Change the `viewFormats` field of this object."] #[doc = ""] @@ -191,18 +177,71 @@ impl GpuTextureDescriptor { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "viewFormats")] + pub fn set_view_formats(this: &GpuTextureDescriptor, val: &::wasm_bindgen::JsValue); +} + +impl GpuTextureDescriptor { + #[doc = "Construct a new `GpuTextureDescriptor`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuTextureDescriptor`, `GpuTextureFormat`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new(format: GpuTextureFormat, size: &::wasm_bindgen::JsValue, usage: u32) -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret.set_format(format); + ret.set_size(size); + ret.set_usage(usage); + ret + } + + #[deprecated = "Use `set_label()` instead."] + pub fn label(&mut self, val: &str) -> &mut Self { + self.set_label(val); + self + } + + #[deprecated = "Use `set_dimension()` instead."] + pub fn dimension(&mut self, val: GpuTextureDimension) -> &mut Self { + self.set_dimension(val); + self + } + + #[deprecated = "Use `set_format()` instead."] + pub fn format(&mut self, val: GpuTextureFormat) -> &mut Self { + self.set_format(val); + self + } + + #[deprecated = "Use `set_mip_level_count()` instead."] + pub fn mip_level_count(&mut self, val: u32) -> &mut Self { + self.set_mip_level_count(val); + self + } + + #[deprecated = "Use `set_sample_count()` instead."] + pub fn sample_count(&mut self, val: u32) -> &mut Self { + self.set_sample_count(val); + self + } + + #[deprecated = "Use `set_size()` instead."] + pub fn size(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { + self.set_size(val); + self + } + + #[deprecated = "Use `set_usage()` instead."] + pub fn usage(&mut self, val: u32) -> &mut Self { + self.set_usage(val); + self + } + + #[deprecated = "Use `set_view_formats()` instead."] pub fn view_formats(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("viewFormats"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_view_formats(val); self } } diff --git a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuTextureDimension.rs b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuTextureDimension.rs index 4c321802fb..3e3c5c6812 100644 --- a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuTextureDimension.rs +++ b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuTextureDimension.rs @@ -18,7 +18,7 @@ // // If you want to improve the generated code, please submit a PR to the https://github.com/rustwasm/wasm-bindgen repository. // -// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.91` command. +// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.97` command. #![allow(unused_imports)] #![allow(clippy::all)] use wasm_bindgen::prelude::*; diff --git a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuTextureFormat.rs b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuTextureFormat.rs index d554598559..63df3f5665 100644 --- a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuTextureFormat.rs +++ b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuTextureFormat.rs @@ -18,7 +18,7 @@ // // If you want to improve the generated code, please submit a PR to the https://github.com/rustwasm/wasm-bindgen repository. // -// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.91` command. +// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.97` command. #![allow(unused_imports)] #![allow(clippy::all)] use wasm_bindgen::prelude::*; diff --git a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuTextureSampleType.rs b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuTextureSampleType.rs index 22ba921800..91a4e985f3 100644 --- a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuTextureSampleType.rs +++ b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuTextureSampleType.rs @@ -18,7 +18,7 @@ // // If you want to improve the generated code, please submit a PR to the https://github.com/rustwasm/wasm-bindgen repository. // -// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.91` command. +// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.97` command. #![allow(unused_imports)] #![allow(clippy::all)] use wasm_bindgen::prelude::*; diff --git a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuTextureView.rs b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuTextureView.rs index e4d113d385..2edf02f7ee 100644 --- a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuTextureView.rs +++ b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuTextureView.rs @@ -18,7 +18,7 @@ // // If you want to improve the generated code, please submit a PR to the https://github.com/rustwasm/wasm-bindgen repository. // -// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.91` command. +// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.97` command. #![allow(unused_imports)] #![allow(clippy::all)] use super::*; @@ -47,7 +47,7 @@ extern "C" { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn label(this: &GpuTextureView) -> String; + pub fn label(this: &GpuTextureView) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "GPUTextureView" , js_name = label)] #[doc = "Setter for the `label` field of this object."] diff --git a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuTextureViewDescriptor.rs b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuTextureViewDescriptor.rs index 6d5ae0a47c..db48b8cdb3 100644 --- a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuTextureViewDescriptor.rs +++ b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuTextureViewDescriptor.rs @@ -18,7 +18,7 @@ // // If you want to improve the generated code, please submit a PR to the https://github.com/rustwasm/wasm-bindgen repository. // -// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.91` command. +// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.97` command. #![allow(unused_imports)] #![allow(clippy::all)] use super::*; @@ -35,20 +35,15 @@ extern "C" { #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub type GpuTextureViewDescriptor; -} -impl GpuTextureViewDescriptor { - #[doc = "Construct a new `GpuTextureViewDescriptor`."] + #[doc = "Get the `label` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `GpuTextureViewDescriptor`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn new() -> Self { - #[allow(unused_mut)] - let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); - ret - } + #[wasm_bindgen(method, getter = "label")] + pub fn get_label(this: &GpuTextureViewDescriptor) -> Option<::alloc::string::String>; #[doc = "Change the `label` field of this object."] #[doc = ""] @@ -56,16 +51,17 @@ impl GpuTextureViewDescriptor { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn label(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("label"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "label")] + pub fn set_label(this: &GpuTextureViewDescriptor, val: &str); + + #[doc = "Get the `arrayLayerCount` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuTextureViewDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "arrayLayerCount")] + pub fn get_array_layer_count(this: &GpuTextureViewDescriptor) -> Option; #[doc = "Change the `arrayLayerCount` field of this object."] #[doc = ""] @@ -73,20 +69,17 @@ impl GpuTextureViewDescriptor { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn array_layer_count(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("arrayLayerCount"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "arrayLayerCount")] + pub fn set_array_layer_count(this: &GpuTextureViewDescriptor, val: u32); + + #[doc = "Get the `aspect` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuTextureAspect`, `GpuTextureViewDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "aspect")] + pub fn get_aspect(this: &GpuTextureViewDescriptor) -> Option; #[doc = "Change the `aspect` field of this object."] #[doc = ""] @@ -94,17 +87,17 @@ impl GpuTextureViewDescriptor { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn aspect(&mut self, val: GpuTextureAspect) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("aspect"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "aspect")] + pub fn set_aspect(this: &GpuTextureViewDescriptor, val: GpuTextureAspect); + + #[doc = "Get the `baseArrayLayer` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuTextureViewDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "baseArrayLayer")] + pub fn get_base_array_layer(this: &GpuTextureViewDescriptor) -> Option; #[doc = "Change the `baseArrayLayer` field of this object."] #[doc = ""] @@ -112,20 +105,17 @@ impl GpuTextureViewDescriptor { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn base_array_layer(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("baseArrayLayer"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "baseArrayLayer")] + pub fn set_base_array_layer(this: &GpuTextureViewDescriptor, val: u32); + + #[doc = "Get the `baseMipLevel` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuTextureViewDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "baseMipLevel")] + pub fn get_base_mip_level(this: &GpuTextureViewDescriptor) -> Option; #[doc = "Change the `baseMipLevel` field of this object."] #[doc = ""] @@ -133,20 +123,17 @@ impl GpuTextureViewDescriptor { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn base_mip_level(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("baseMipLevel"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "baseMipLevel")] + pub fn set_base_mip_level(this: &GpuTextureViewDescriptor, val: u32); + + #[doc = "Get the `dimension` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuTextureViewDescriptor`, `GpuTextureViewDimension`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "dimension")] + pub fn get_dimension(this: &GpuTextureViewDescriptor) -> Option; #[doc = "Change the `dimension` field of this object."] #[doc = ""] @@ -154,20 +141,17 @@ impl GpuTextureViewDescriptor { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn dimension(&mut self, val: GpuTextureViewDimension) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("dimension"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "dimension")] + pub fn set_dimension(this: &GpuTextureViewDescriptor, val: GpuTextureViewDimension); + + #[doc = "Get the `format` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuTextureFormat`, `GpuTextureViewDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "format")] + pub fn get_format(this: &GpuTextureViewDescriptor) -> Option; #[doc = "Change the `format` field of this object."] #[doc = ""] @@ -175,17 +159,17 @@ impl GpuTextureViewDescriptor { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn format(&mut self, val: GpuTextureFormat) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("format"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "format")] + pub fn set_format(this: &GpuTextureViewDescriptor, val: GpuTextureFormat); + + #[doc = "Get the `mipLevelCount` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuTextureViewDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "mipLevelCount")] + pub fn get_mip_level_count(this: &GpuTextureViewDescriptor) -> Option; #[doc = "Change the `mipLevelCount` field of this object."] #[doc = ""] @@ -193,18 +177,92 @@ impl GpuTextureViewDescriptor { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "mipLevelCount")] + pub fn set_mip_level_count(this: &GpuTextureViewDescriptor, val: u32); + + #[doc = "Get the `usage` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuTextureViewDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "usage")] + pub fn get_usage(this: &GpuTextureViewDescriptor) -> Option; + + #[doc = "Change the `usage` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuTextureViewDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "usage")] + pub fn set_usage(this: &GpuTextureViewDescriptor, val: u32); +} + +impl GpuTextureViewDescriptor { + #[doc = "Construct a new `GpuTextureViewDescriptor`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuTextureViewDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new() -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret + } + + #[deprecated = "Use `set_label()` instead."] + pub fn label(&mut self, val: &str) -> &mut Self { + self.set_label(val); + self + } + + #[deprecated = "Use `set_array_layer_count()` instead."] + pub fn array_layer_count(&mut self, val: u32) -> &mut Self { + self.set_array_layer_count(val); + self + } + + #[deprecated = "Use `set_aspect()` instead."] + pub fn aspect(&mut self, val: GpuTextureAspect) -> &mut Self { + self.set_aspect(val); + self + } + + #[deprecated = "Use `set_base_array_layer()` instead."] + pub fn base_array_layer(&mut self, val: u32) -> &mut Self { + self.set_base_array_layer(val); + self + } + + #[deprecated = "Use `set_base_mip_level()` instead."] + pub fn base_mip_level(&mut self, val: u32) -> &mut Self { + self.set_base_mip_level(val); + self + } + + #[deprecated = "Use `set_dimension()` instead."] + pub fn dimension(&mut self, val: GpuTextureViewDimension) -> &mut Self { + self.set_dimension(val); + self + } + + #[deprecated = "Use `set_format()` instead."] + pub fn format(&mut self, val: GpuTextureFormat) -> &mut Self { + self.set_format(val); + self + } + + #[deprecated = "Use `set_mip_level_count()` instead."] pub fn mip_level_count(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("mipLevelCount"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_mip_level_count(val); + self + } + + #[deprecated = "Use `set_usage()` instead."] + pub fn usage(&mut self, val: u32) -> &mut Self { + self.set_usage(val); self } } diff --git a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuTextureViewDimension.rs b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuTextureViewDimension.rs index c6b205ea62..1878f41c6c 100644 --- a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuTextureViewDimension.rs +++ b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuTextureViewDimension.rs @@ -18,7 +18,7 @@ // // If you want to improve the generated code, please submit a PR to the https://github.com/rustwasm/wasm-bindgen repository. // -// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.91` command. +// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.97` command. #![allow(unused_imports)] #![allow(clippy::all)] use wasm_bindgen::prelude::*; diff --git a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuUncapturedErrorEvent.rs b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuUncapturedErrorEvent.rs index cdc850b539..015f07907b 100644 --- a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuUncapturedErrorEvent.rs +++ b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuUncapturedErrorEvent.rs @@ -18,7 +18,7 @@ // // If you want to improve the generated code, please submit a PR to the https://github.com/rustwasm/wasm-bindgen repository. // -// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.91` command. +// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.97` command. #![allow(unused_imports)] #![allow(clippy::all)] use super::*; diff --git a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuUncapturedErrorEventInit.rs b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuUncapturedErrorEventInit.rs index 658dfaa8ad..555607c314 100644 --- a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuUncapturedErrorEventInit.rs +++ b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuUncapturedErrorEventInit.rs @@ -18,7 +18,7 @@ // // If you want to improve the generated code, please submit a PR to the https://github.com/rustwasm/wasm-bindgen repository. // -// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.91` command. +// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.97` command. #![allow(unused_imports)] #![allow(clippy::all)] use super::*; @@ -35,21 +35,15 @@ extern "C" { #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub type GpuUncapturedErrorEventInit; -} -impl GpuUncapturedErrorEventInit { - #[doc = "Construct a new `GpuUncapturedErrorEventInit`."] + #[doc = "Get the `bubbles` field of this object."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuError`, `GpuUncapturedErrorEventInit`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuUncapturedErrorEventInit`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn new(error: &GpuError) -> Self { - #[allow(unused_mut)] - let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); - ret.error(error); - ret - } + #[wasm_bindgen(method, getter = "bubbles")] + pub fn get_bubbles(this: &GpuUncapturedErrorEventInit) -> Option; #[doc = "Change the `bubbles` field of this object."] #[doc = ""] @@ -57,20 +51,17 @@ impl GpuUncapturedErrorEventInit { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn bubbles(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("bubbles"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "bubbles")] + pub fn set_bubbles(this: &GpuUncapturedErrorEventInit, val: bool); + + #[doc = "Get the `cancelable` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuUncapturedErrorEventInit`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "cancelable")] + pub fn get_cancelable(this: &GpuUncapturedErrorEventInit) -> Option; #[doc = "Change the `cancelable` field of this object."] #[doc = ""] @@ -78,20 +69,17 @@ impl GpuUncapturedErrorEventInit { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn cancelable(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("cancelable"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "cancelable")] + pub fn set_cancelable(this: &GpuUncapturedErrorEventInit, val: bool); + + #[doc = "Get the `composed` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuUncapturedErrorEventInit`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "composed")] + pub fn get_composed(this: &GpuUncapturedErrorEventInit) -> Option; #[doc = "Change the `composed` field of this object."] #[doc = ""] @@ -99,20 +87,17 @@ impl GpuUncapturedErrorEventInit { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn composed(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("composed"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "composed")] + pub fn set_composed(this: &GpuUncapturedErrorEventInit, val: bool); + + #[doc = "Get the `error` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuError`, `GpuUncapturedErrorEventInit`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "error")] + pub fn get_error(this: &GpuUncapturedErrorEventInit) -> GpuError; #[doc = "Change the `error` field of this object."] #[doc = ""] @@ -120,14 +105,45 @@ impl GpuUncapturedErrorEventInit { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "error")] + pub fn set_error(this: &GpuUncapturedErrorEventInit, val: &GpuError); +} + +impl GpuUncapturedErrorEventInit { + #[doc = "Construct a new `GpuUncapturedErrorEventInit`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuError`, `GpuUncapturedErrorEventInit`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new(error: &GpuError) -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret.set_error(error); + ret + } + + #[deprecated = "Use `set_bubbles()` instead."] + pub fn bubbles(&mut self, val: bool) -> &mut Self { + self.set_bubbles(val); + self + } + + #[deprecated = "Use `set_cancelable()` instead."] + pub fn cancelable(&mut self, val: bool) -> &mut Self { + self.set_cancelable(val); + self + } + + #[deprecated = "Use `set_composed()` instead."] + pub fn composed(&mut self, val: bool) -> &mut Self { + self.set_composed(val); + self + } + + #[deprecated = "Use `set_error()` instead."] pub fn error(&mut self, val: &GpuError) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("error"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_error(val); self } } diff --git a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuValidationError.rs b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuValidationError.rs index f28d2c420c..87ef8a5b6f 100644 --- a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuValidationError.rs +++ b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuValidationError.rs @@ -18,7 +18,7 @@ // // If you want to improve the generated code, please submit a PR to the https://github.com/rustwasm/wasm-bindgen repository. // -// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.91` command. +// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.97` command. #![allow(unused_imports)] #![allow(clippy::all)] use super::*; diff --git a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuVertexAttribute.rs b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuVertexAttribute.rs index a67d2ea2dd..a8260b418b 100644 --- a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuVertexAttribute.rs +++ b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuVertexAttribute.rs @@ -18,7 +18,7 @@ // // If you want to improve the generated code, please submit a PR to the https://github.com/rustwasm/wasm-bindgen repository. // -// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.91` command. +// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.97` command. #![allow(unused_imports)] #![allow(clippy::all)] use super::*; @@ -35,23 +35,15 @@ extern "C" { #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub type GpuVertexAttribute; -} -impl GpuVertexAttribute { - #[doc = "Construct a new `GpuVertexAttribute`."] + #[doc = "Get the `format` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `GpuVertexAttribute`, `GpuVertexFormat`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn new(format: GpuVertexFormat, offset: f64, shader_location: u32) -> Self { - #[allow(unused_mut)] - let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); - ret.format(format); - ret.offset(offset); - ret.shader_location(shader_location); - ret - } + #[wasm_bindgen(method, getter = "format")] + pub fn get_format(this: &GpuVertexAttribute) -> GpuVertexFormat; #[doc = "Change the `format` field of this object."] #[doc = ""] @@ -59,17 +51,17 @@ impl GpuVertexAttribute { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn format(&mut self, val: GpuVertexFormat) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("format"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "format")] + pub fn set_format(this: &GpuVertexAttribute, val: GpuVertexFormat); + + #[doc = "Get the `offset` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuVertexAttribute`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "offset")] + pub fn get_offset(this: &GpuVertexAttribute) -> f64; #[doc = "Change the `offset` field of this object."] #[doc = ""] @@ -77,17 +69,17 @@ impl GpuVertexAttribute { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn offset(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("offset"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "offset")] + pub fn set_offset(this: &GpuVertexAttribute, val: f64); + + #[doc = "Get the `shaderLocation` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuVertexAttribute`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "shaderLocation")] + pub fn get_shader_location(this: &GpuVertexAttribute) -> u32; #[doc = "Change the `shaderLocation` field of this object."] #[doc = ""] @@ -95,18 +87,41 @@ impl GpuVertexAttribute { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "shaderLocation")] + pub fn set_shader_location(this: &GpuVertexAttribute, val: u32); +} + +impl GpuVertexAttribute { + #[doc = "Construct a new `GpuVertexAttribute`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuVertexAttribute`, `GpuVertexFormat`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new(format: GpuVertexFormat, offset: f64, shader_location: u32) -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret.set_format(format); + ret.set_offset(offset); + ret.set_shader_location(shader_location); + ret + } + + #[deprecated = "Use `set_format()` instead."] + pub fn format(&mut self, val: GpuVertexFormat) -> &mut Self { + self.set_format(val); + self + } + + #[deprecated = "Use `set_offset()` instead."] + pub fn offset(&mut self, val: f64) -> &mut Self { + self.set_offset(val); + self + } + + #[deprecated = "Use `set_shader_location()` instead."] pub fn shader_location(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("shaderLocation"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_shader_location(val); self } } diff --git a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuVertexBufferLayout.rs b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuVertexBufferLayout.rs index ebd1f176d5..d05413bd91 100644 --- a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuVertexBufferLayout.rs +++ b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuVertexBufferLayout.rs @@ -18,7 +18,7 @@ // // If you want to improve the generated code, please submit a PR to the https://github.com/rustwasm/wasm-bindgen repository. // -// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.91` command. +// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.97` command. #![allow(unused_imports)] #![allow(clippy::all)] use super::*; @@ -35,22 +35,15 @@ extern "C" { #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub type GpuVertexBufferLayout; -} -impl GpuVertexBufferLayout { - #[doc = "Construct a new `GpuVertexBufferLayout`."] + #[doc = "Get the `arrayStride` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `GpuVertexBufferLayout`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn new(array_stride: f64, attributes: &::wasm_bindgen::JsValue) -> Self { - #[allow(unused_mut)] - let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); - ret.array_stride(array_stride); - ret.attributes(attributes); - ret - } + #[wasm_bindgen(method, getter = "arrayStride")] + pub fn get_array_stride(this: &GpuVertexBufferLayout) -> f64; #[doc = "Change the `arrayStride` field of this object."] #[doc = ""] @@ -58,20 +51,17 @@ impl GpuVertexBufferLayout { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn array_stride(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("arrayStride"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "arrayStride")] + pub fn set_array_stride(this: &GpuVertexBufferLayout, val: f64); + + #[doc = "Get the `attributes` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuVertexBufferLayout`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "attributes")] + pub fn get_attributes(this: &GpuVertexBufferLayout) -> ::js_sys::Array; #[doc = "Change the `attributes` field of this object."] #[doc = ""] @@ -79,20 +69,17 @@ impl GpuVertexBufferLayout { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn attributes(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("attributes"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "attributes")] + pub fn set_attributes(this: &GpuVertexBufferLayout, val: &::wasm_bindgen::JsValue); + + #[doc = "Get the `stepMode` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuVertexBufferLayout`, `GpuVertexStepMode`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "stepMode")] + pub fn get_step_mode(this: &GpuVertexBufferLayout) -> Option; #[doc = "Change the `stepMode` field of this object."] #[doc = ""] @@ -100,18 +87,40 @@ impl GpuVertexBufferLayout { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "stepMode")] + pub fn set_step_mode(this: &GpuVertexBufferLayout, val: GpuVertexStepMode); +} + +impl GpuVertexBufferLayout { + #[doc = "Construct a new `GpuVertexBufferLayout`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuVertexBufferLayout`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new(array_stride: f64, attributes: &::wasm_bindgen::JsValue) -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret.set_array_stride(array_stride); + ret.set_attributes(attributes); + ret + } + + #[deprecated = "Use `set_array_stride()` instead."] + pub fn array_stride(&mut self, val: f64) -> &mut Self { + self.set_array_stride(val); + self + } + + #[deprecated = "Use `set_attributes()` instead."] + pub fn attributes(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { + self.set_attributes(val); + self + } + + #[deprecated = "Use `set_step_mode()` instead."] pub fn step_mode(&mut self, val: GpuVertexStepMode) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("stepMode"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_step_mode(val); self } } diff --git a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuVertexFormat.rs b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuVertexFormat.rs index 972be0205f..67eb10514f 100644 --- a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuVertexFormat.rs +++ b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuVertexFormat.rs @@ -18,7 +18,7 @@ // // If you want to improve the generated code, please submit a PR to the https://github.com/rustwasm/wasm-bindgen repository. // -// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.91` command. +// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.97` command. #![allow(unused_imports)] #![allow(clippy::all)] use wasm_bindgen::prelude::*; @@ -32,22 +32,31 @@ use wasm_bindgen::prelude::*; #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] #[derive(Debug, Clone, Copy, PartialEq, Eq)] pub enum GpuVertexFormat { + Uint8 = "uint8", Uint8x2 = "uint8x2", Uint8x4 = "uint8x4", + Sint8 = "sint8", Sint8x2 = "sint8x2", Sint8x4 = "sint8x4", + Unorm8 = "unorm8", Unorm8x2 = "unorm8x2", Unorm8x4 = "unorm8x4", + Snorm8 = "snorm8", Snorm8x2 = "snorm8x2", Snorm8x4 = "snorm8x4", + Uint16 = "uint16", Uint16x2 = "uint16x2", Uint16x4 = "uint16x4", + Sint16 = "sint16", Sint16x2 = "sint16x2", Sint16x4 = "sint16x4", + Unorm16 = "unorm16", Unorm16x2 = "unorm16x2", Unorm16x4 = "unorm16x4", + Snorm16 = "snorm16", Snorm16x2 = "snorm16x2", Snorm16x4 = "snorm16x4", + Float16 = "float16", Float16x2 = "float16x2", Float16x4 = "float16x4", Float32 = "float32", @@ -63,4 +72,5 @@ pub enum GpuVertexFormat { Sint32x3 = "sint32x3", Sint32x4 = "sint32x4", Unorm1010102 = "unorm10-10-10-2", + Unorm8x4Bgra = "unorm8x4-bgra", } diff --git a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuVertexState.rs b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuVertexState.rs index fe7d2c86a0..faac3a11b9 100644 --- a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuVertexState.rs +++ b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuVertexState.rs @@ -18,7 +18,7 @@ // // If you want to improve the generated code, please submit a PR to the https://github.com/rustwasm/wasm-bindgen repository. // -// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.91` command. +// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.97` command. #![allow(unused_imports)] #![allow(clippy::all)] use super::*; @@ -35,21 +35,33 @@ extern "C" { #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub type GpuVertexState; -} -impl GpuVertexState { - #[doc = "Construct a new `GpuVertexState`."] + #[doc = "Get the `constants` field of this object."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuShaderModule`, `GpuVertexState`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuVertexState`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn new(module: &GpuShaderModule) -> Self { - #[allow(unused_mut)] - let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); - ret.module(module); - ret - } + #[wasm_bindgen(method, getter = "constants")] + pub fn get_constants(this: &GpuVertexState) -> Option<::js_sys::Object>; + + #[doc = "Change the `constants` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuVertexState`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "constants")] + pub fn set_constants(this: &GpuVertexState, val: &::js_sys::Object); + + #[doc = "Get the `entryPoint` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuVertexState`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "entryPoint")] + pub fn get_entry_point(this: &GpuVertexState) -> Option<::alloc::string::String>; #[doc = "Change the `entryPoint` field of this object."] #[doc = ""] @@ -57,20 +69,17 @@ impl GpuVertexState { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn entry_point(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("entryPoint"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "entryPoint")] + pub fn set_entry_point(this: &GpuVertexState, val: &str); + + #[doc = "Get the `module` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuShaderModule`, `GpuVertexState`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "module")] + pub fn get_module(this: &GpuVertexState) -> GpuShaderModule; #[doc = "Change the `module` field of this object."] #[doc = ""] @@ -78,17 +87,17 @@ impl GpuVertexState { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn module(&mut self, val: &GpuShaderModule) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("module"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "module")] + pub fn set_module(this: &GpuVertexState, val: &GpuShaderModule); + + #[doc = "Get the `buffers` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuVertexState`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "buffers")] + pub fn get_buffers(this: &GpuVertexState) -> Option<::js_sys::Array>; #[doc = "Change the `buffers` field of this object."] #[doc = ""] @@ -96,18 +105,45 @@ impl GpuVertexState { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "buffers")] + pub fn set_buffers(this: &GpuVertexState, val: &::wasm_bindgen::JsValue); +} + +impl GpuVertexState { + #[doc = "Construct a new `GpuVertexState`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuShaderModule`, `GpuVertexState`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new(module: &GpuShaderModule) -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret.set_module(module); + ret + } + + #[deprecated = "Use `set_constants()` instead."] + pub fn constants(&mut self, val: &::js_sys::Object) -> &mut Self { + self.set_constants(val); + self + } + + #[deprecated = "Use `set_entry_point()` instead."] + pub fn entry_point(&mut self, val: &str) -> &mut Self { + self.set_entry_point(val); + self + } + + #[deprecated = "Use `set_module()` instead."] + pub fn module(&mut self, val: &GpuShaderModule) -> &mut Self { + self.set_module(val); + self + } + + #[deprecated = "Use `set_buffers()` instead."] pub fn buffers(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("buffers"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_buffers(val); self } } diff --git a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuVertexStepMode.rs b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuVertexStepMode.rs index 220df95015..556609d547 100644 --- a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuVertexStepMode.rs +++ b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuVertexStepMode.rs @@ -18,7 +18,7 @@ // // If you want to improve the generated code, please submit a PR to the https://github.com/rustwasm/wasm-bindgen repository. // -// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.91` command. +// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.97` command. #![allow(unused_imports)] #![allow(clippy::all)] use wasm_bindgen::prelude::*; diff --git a/wgpu/src/backend/webgpu/webgpu_sys/gen_WgslLanguageFeatures.rs b/wgpu/src/backend/webgpu/webgpu_sys/gen_WgslLanguageFeatures.rs index 571da0a756..cd0cd77047 100644 --- a/wgpu/src/backend/webgpu/webgpu_sys/gen_WgslLanguageFeatures.rs +++ b/wgpu/src/backend/webgpu/webgpu_sys/gen_WgslLanguageFeatures.rs @@ -18,7 +18,7 @@ // // If you want to improve the generated code, please submit a PR to the https://github.com/rustwasm/wasm-bindgen repository. // -// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.91` command. +// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.97` command. #![allow(unused_imports)] #![allow(clippy::all)] use super::*; diff --git a/wgpu/src/backend/webgpu/webgpu_sys/gen_gpu_map_mode.rs b/wgpu/src/backend/webgpu/webgpu_sys/gen_gpu_map_mode.rs index 7448085f47..c63dbff356 100644 --- a/wgpu/src/backend/webgpu/webgpu_sys/gen_gpu_map_mode.rs +++ b/wgpu/src/backend/webgpu/webgpu_sys/gen_gpu_map_mode.rs @@ -18,7 +18,7 @@ // // If you want to improve the generated code, please submit a PR to the https://github.com/rustwasm/wasm-bindgen repository. // -// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.91` command. +// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.97` command. #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] diff --git a/wgpu/src/backend/webgpu/webgpu_sys/mod.rs b/wgpu/src/backend/webgpu/webgpu_sys/mod.rs index f4e3ddf93d..3e703d3bb2 100644 --- a/wgpu/src/backend/webgpu/webgpu_sys/mod.rs +++ b/wgpu/src/backend/webgpu/webgpu_sys/mod.rs @@ -21,7 +21,7 @@ // // If you want to improve the generated code, please submit a PR to the https://github.com/rustwasm/wasm-bindgen repository. // -// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.91` command. +// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.97` command. #![allow(unused_imports, non_snake_case)] use web_sys::{Event, EventTarget}; @@ -29,6 +29,8 @@ mod gen_Gpu; pub use gen_Gpu::*; mod gen_GpuAdapter; pub use gen_GpuAdapter::*; +mod gen_GpuAdapterInfo; +pub use gen_GpuAdapterInfo::*; mod gen_GpuAddressMode; pub use gen_GpuAddressMode::*; mod gen_GpuAutoLayoutMode; @@ -71,6 +73,10 @@ mod gen_GpuCanvasContext; pub use gen_GpuCanvasContext::*; mod gen_GpuCanvasConfiguration; pub use gen_GpuCanvasConfiguration::*; +mod gen_GpuCanvasToneMapping; +pub use gen_GpuCanvasToneMapping::*; +mod gen_GpuCanvasToneMappingMode; +pub use gen_GpuCanvasToneMappingMode::*; mod gen_GpuColorDict; pub use gen_GpuColorDict::*; mod gen_GpuColorTargetState; @@ -133,16 +139,16 @@ mod gen_GpuFragmentState; pub use gen_GpuFragmentState::*; mod gen_GpuFrontFace; pub use gen_GpuFrontFace::*; -mod gen_GpuImageCopyBuffer; -pub use gen_GpuImageCopyBuffer::*; -mod gen_GpuImageCopyExternalImage; -pub use gen_GpuImageCopyExternalImage::*; -mod gen_GpuImageCopyTexture; -pub use gen_GpuImageCopyTexture::*; -mod gen_GpuImageCopyTextureTagged; -pub use gen_GpuImageCopyTextureTagged::*; -mod gen_GpuImageDataLayout; -pub use gen_GpuImageDataLayout::*; +mod gen_GpuTexelCopyBufferInfo; +pub use gen_GpuTexelCopyBufferInfo::*; +mod gen_GpuCopyExternalImageSourceInfo; +pub use gen_GpuCopyExternalImageSourceInfo::*; +mod gen_GpuTexelCopyTextureInfo; +pub use gen_GpuTexelCopyTextureInfo::*; +mod gen_GpuCopyExternalImageDestInfo; +pub use gen_GpuCopyExternalImageDestInfo::*; +mod gen_GpuTexelCopyBufferLayout; +pub use gen_GpuTexelCopyBufferLayout::*; mod gen_GpuIndexFormat; pub use gen_GpuIndexFormat::*; mod gen_GpuLoadOp; diff --git a/wgpu/src/lib.rs b/wgpu/src/lib.rs index 77c5a09480..0e1f4357f4 100644 --- a/wgpu/src/lib.rs +++ b/wgpu/src/lib.rs @@ -122,3 +122,8 @@ pub use raw_window_handle as rwh; /// #[cfg(any(webgl, webgpu))] pub use web_sys; + +/// `web-sys` has a `no_std` mode, and instead refers to the `alloc` crate in its generated code. +/// Since we vendor the WebGPU bindings we need to explicitly add the `alloc` crate ourselves. +#[cfg(webgpu)] +extern crate alloc; diff --git a/xtask/src/vendor_web_sys.rs b/xtask/src/vendor_web_sys.rs index 5f92f430e9..451e95465e 100644 --- a/xtask/src/vendor_web_sys.rs +++ b/xtask/src/vendor_web_sys.rs @@ -19,6 +19,7 @@ const WEB_SYS_FILE_PREFIX: &str = "crates/web-sys/src/features/gen_"; const WEB_SYS_FEATURES_NEEDED: &[&str] = &[ "Gpu", "GpuAdapter", + "GpuAdapterInfo", "GpuAddressMode", "GpuAutoLayoutMode", "GpuBindGroup", @@ -40,6 +41,8 @@ const WEB_SYS_FEATURES_NEEDED: &[&str] = &[ "GpuCanvasAlphaMode", "GpuCanvasContext", "GpuCanvasConfiguration", + "GpuCanvasToneMapping", + "GpuCanvasToneMappingMode", "GpuColorDict", "GpuColorTargetState", "GpuCommandBuffer", @@ -72,11 +75,11 @@ const WEB_SYS_FEATURES_NEEDED: &[&str] = &[ "GpuFilterMode", "GpuFragmentState", "GpuFrontFace", - "GpuImageCopyBuffer", - "GpuImageCopyExternalImage", - "GpuImageCopyTexture", - "GpuImageCopyTextureTagged", - "GpuImageDataLayout", + "GpuTexelCopyBufferInfo", + "GpuCopyExternalImageSourceInfo", + "GpuTexelCopyTextureInfo", + "GpuCopyExternalImageDestInfo", + "GpuTexelCopyBufferLayout", "GpuIndexFormat", "GpuLoadOp", "gpu_map_mode",