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    #[cfg(feature = "GpuPipelineLayout")]
37    #[doc = "Get the `layout` field of this object."]
38    #[doc = ""]
39    #[doc = "*This API requires the following crate features to be activated: `GpuComputePipelineDescriptor`, `GpuPipelineLayout`*"]
40    #[doc = ""]
41    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
42    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
43    #[wasm_bindgen(method, getter = "layout")]
44    pub fn get_layout(this: &GpuComputePipelineDescriptor) -> ::wasm_bindgen::JsValue;
45    #[cfg(web_sys_unstable_apis)]
46    #[cfg(feature = "GpuPipelineLayout")]
47    #[doc = "Change the `layout` field of this object."]
48    #[doc = ""]
49    #[doc = "*This API requires the following crate features to be activated: `GpuComputePipelineDescriptor`, `GpuPipelineLayout`*"]
50    #[doc = ""]
51    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
52    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
53    #[wasm_bindgen(method, setter = "layout")]
54    pub fn set_layout(this: &GpuComputePipelineDescriptor, val: &GpuPipelineLayout);
55    #[cfg(web_sys_unstable_apis)]
56    #[cfg(feature = "GpuAutoLayoutMode")]
57    #[doc = "Change the `layout` field of this object."]
58    #[doc = ""]
59    #[doc = "*This API requires the following crate features to be activated: `GpuAutoLayoutMode`, `GpuComputePipelineDescriptor`*"]
60    #[doc = ""]
61    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
62    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
63    #[wasm_bindgen(method, setter = "layout")]
64    pub fn set_layout_gpu_auto_layout_mode(
65        this: &GpuComputePipelineDescriptor,
66        val: GpuAutoLayoutMode,
67    );
68    #[cfg(web_sys_unstable_apis)]
69    #[cfg(feature = "GpuProgrammableStage")]
70    #[doc = "Get the `compute` field of this object."]
71    #[doc = ""]
72    #[doc = "*This API requires the following crate features to be activated: `GpuComputePipelineDescriptor`, `GpuProgrammableStage`*"]
73    #[doc = ""]
74    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
75    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
76    #[wasm_bindgen(method, getter = "compute")]
77    pub fn get_compute(this: &GpuComputePipelineDescriptor) -> GpuProgrammableStage;
78    #[cfg(web_sys_unstable_apis)]
79    #[cfg(feature = "GpuProgrammableStage")]
80    #[doc = "Change the `compute` field of this object."]
81    #[doc = ""]
82    #[doc = "*This API requires the following crate features to be activated: `GpuComputePipelineDescriptor`, `GpuProgrammableStage`*"]
83    #[doc = ""]
84    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
85    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
86    #[wasm_bindgen(method, setter = "compute")]
87    pub fn set_compute(this: &GpuComputePipelineDescriptor, val: &GpuProgrammableStage);
88}
89#[cfg(web_sys_unstable_apis)]
90impl GpuComputePipelineDescriptor {
91    #[cfg(all(feature = "GpuPipelineLayout", feature = "GpuProgrammableStage",))]
92    #[doc = "Construct a new `GpuComputePipelineDescriptor`."]
93    #[doc = ""]
94    #[doc = "*This API requires the following crate features to be activated: `GpuComputePipelineDescriptor`, `GpuPipelineLayout`, `GpuProgrammableStage`*"]
95    #[doc = ""]
96    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
97    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
98    pub fn new(layout: &GpuPipelineLayout, compute: &GpuProgrammableStage) -> Self {
99        #[allow(unused_mut)]
100        let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
101        ret.set_layout(layout);
102        ret.set_compute(compute);
103        ret
104    }
105    #[cfg(all(feature = "GpuAutoLayoutMode", feature = "GpuProgrammableStage",))]
106    #[doc = "Construct a new `GpuComputePipelineDescriptor`."]
107    #[doc = ""]
108    #[doc = "*This API requires the following crate features to be activated: `GpuAutoLayoutMode`, `GpuComputePipelineDescriptor`, `GpuProgrammableStage`*"]
109    #[doc = ""]
110    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
111    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
112    pub fn new_with_gpu_auto_layout_mode(
113        layout: GpuAutoLayoutMode,
114        compute: &GpuProgrammableStage,
115    ) -> Self {
116        #[allow(unused_mut)]
117        let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
118        ret.set_layout_gpu_auto_layout_mode(layout);
119        ret.set_compute(compute);
120        ret
121    }
122    #[cfg(web_sys_unstable_apis)]
123    #[deprecated = "Use `set_label()` instead."]
124    pub fn label(&mut self, val: &str) -> &mut Self {
125        self.set_label(val);
126        self
127    }
128    #[cfg(web_sys_unstable_apis)]
129    #[cfg(feature = "GpuPipelineLayout")]
130    #[deprecated = "Use `set_layout()` instead."]
131    pub fn layout(&mut self, val: &GpuPipelineLayout) -> &mut Self {
132        self.set_layout(val);
133        self
134    }
135    #[cfg(web_sys_unstable_apis)]
136    #[cfg(feature = "GpuProgrammableStage")]
137    #[deprecated = "Use `set_compute()` instead."]
138    pub fn compute(&mut self, val: &GpuProgrammableStage) -> &mut Self {
139        self.set_compute(val);
140        self
141    }
142}