Skip to main content

web_sys/features/
gen_GpuComputePipelineDescriptor.rs

1#![allow(unused_imports)]
2#![allow(clippy::all)]
3use super::*;
4use wasm_bindgen::prelude::*;
5#[cfg(web_sys_unstable_apis)]
6#[wasm_bindgen]
7extern "C" {
8    # [wasm_bindgen (extends = :: js_sys :: Object , js_name = GPUComputePipelineDescriptor)]
9    #[derive(Debug, Clone, PartialEq, Eq)]
10    #[doc = "The `GpuComputePipelineDescriptor` dictionary."]
11    #[doc = ""]
12    #[doc = "*This API requires the following crate features to be activated: `GpuComputePipelineDescriptor`*"]
13    #[doc = ""]
14    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
15    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
16    pub type GpuComputePipelineDescriptor;
17    #[cfg(web_sys_unstable_apis)]
18    #[doc = "Get the `label` field of this object."]
19    #[doc = ""]
20    #[doc = "*This API requires the following crate features to be activated: `GpuComputePipelineDescriptor`*"]
21    #[doc = ""]
22    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
23    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
24    #[wasm_bindgen(method, getter = "label")]
25    pub fn get_label(this: &GpuComputePipelineDescriptor) -> Option<::alloc::string::String>;
26    #[cfg(web_sys_unstable_apis)]
27    #[doc = "Change the `label` field of this object."]
28    #[doc = ""]
29    #[doc = "*This API requires the following crate features to be activated: `GpuComputePipelineDescriptor`*"]
30    #[doc = ""]
31    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
32    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
33    #[wasm_bindgen(method, setter = "label")]
34    pub fn set_label(this: &GpuComputePipelineDescriptor, val: &str);
35    #[cfg(web_sys_unstable_apis)]
36    #[doc = "Get the `layout` field of this object."]
37    #[doc = ""]
38    #[doc = "*This API requires the following crate features to be activated: `GpuComputePipelineDescriptor`*"]
39    #[doc = ""]
40    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
41    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
42    #[wasm_bindgen(method, getter = "layout")]
43    pub fn get_layout(this: &GpuComputePipelineDescriptor) -> ::wasm_bindgen::JsValue;
44    #[cfg(web_sys_unstable_apis)]
45    #[cfg(feature = "GpuPipelineLayout")]
46    #[doc = "Change the `layout` field of this object."]
47    #[doc = ""]
48    #[doc = "*This API requires the following crate features to be activated: `GpuComputePipelineDescriptor`*"]
49    #[doc = ""]
50    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
51    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
52    #[wasm_bindgen(method, setter = "layout")]
53    pub fn set_layout(this: &GpuComputePipelineDescriptor, val: &GpuPipelineLayout);
54    #[cfg(web_sys_unstable_apis)]
55    #[cfg(feature = "GpuAutoLayoutMode")]
56    #[doc = "Change the `layout` field of this object."]
57    #[doc = ""]
58    #[doc = "*This API requires the following crate features to be activated: `GpuComputePipelineDescriptor`*"]
59    #[doc = ""]
60    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
61    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
62    #[wasm_bindgen(method, setter = "layout")]
63    pub fn set_layout_gpu_auto_layout_mode(
64        this: &GpuComputePipelineDescriptor,
65        val: GpuAutoLayoutMode,
66    );
67    #[cfg(web_sys_unstable_apis)]
68    #[cfg(feature = "GpuProgrammableStage")]
69    #[doc = "Get the `compute` field of this object."]
70    #[doc = ""]
71    #[doc = "*This API requires the following crate features to be activated: `GpuComputePipelineDescriptor`, `GpuProgrammableStage`*"]
72    #[doc = ""]
73    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
74    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
75    #[wasm_bindgen(method, getter = "compute")]
76    pub fn get_compute(this: &GpuComputePipelineDescriptor) -> GpuProgrammableStage;
77    #[cfg(web_sys_unstable_apis)]
78    #[cfg(feature = "GpuProgrammableStage")]
79    #[doc = "Change the `compute` field of this object."]
80    #[doc = ""]
81    #[doc = "*This API requires the following crate features to be activated: `GpuComputePipelineDescriptor`, `GpuProgrammableStage`*"]
82    #[doc = ""]
83    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
84    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
85    #[wasm_bindgen(method, setter = "compute")]
86    pub fn set_compute(this: &GpuComputePipelineDescriptor, val: &GpuProgrammableStage);
87}
88#[cfg(web_sys_unstable_apis)]
89impl GpuComputePipelineDescriptor {
90    #[cfg(all(feature = "GpuPipelineLayout", feature = "GpuProgrammableStage",))]
91    #[doc = "Construct a new `GpuComputePipelineDescriptor`."]
92    #[doc = ""]
93    #[doc = "*This API requires the following crate features to be activated: `GpuComputePipelineDescriptor`, `GpuPipelineLayout`, `GpuProgrammableStage`*"]
94    #[doc = ""]
95    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
96    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
97    pub fn new(layout: &GpuPipelineLayout, compute: &GpuProgrammableStage) -> Self {
98        #[allow(unused_mut)]
99        let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
100        ret.set_layout(layout);
101        ret.set_compute(compute);
102        ret
103    }
104    #[cfg(all(feature = "GpuAutoLayoutMode", feature = "GpuProgrammableStage",))]
105    #[doc = "Construct a new `GpuComputePipelineDescriptor`."]
106    #[doc = ""]
107    #[doc = "*This API requires the following crate features to be activated: `GpuAutoLayoutMode`, `GpuComputePipelineDescriptor`, `GpuProgrammableStage`*"]
108    #[doc = ""]
109    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
110    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
111    pub fn new_with_gpu_auto_layout_mode(
112        layout: GpuAutoLayoutMode,
113        compute: &GpuProgrammableStage,
114    ) -> Self {
115        #[allow(unused_mut)]
116        let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
117        ret.set_layout_gpu_auto_layout_mode(layout);
118        ret.set_compute(compute);
119        ret
120    }
121    #[cfg(web_sys_unstable_apis)]
122    #[deprecated = "Use `set_label()` instead."]
123    pub fn label(&mut self, val: &str) -> &mut Self {
124        self.set_label(val);
125        self
126    }
127    #[cfg(web_sys_unstable_apis)]
128    #[deprecated = "Use `set_layout()` instead."]
129    pub fn layout(&mut self, val: &GpuPipelineLayout) -> &mut Self {
130        self.set_layout(val);
131        self
132    }
133    #[cfg(web_sys_unstable_apis)]
134    #[cfg(feature = "GpuProgrammableStage")]
135    #[deprecated = "Use `set_compute()` instead."]
136    pub fn compute(&mut self, val: &GpuProgrammableStage) -> &mut Self {
137        self.set_compute(val);
138        self
139    }
140}