Update to latest WebGPU WebIDL (#2080)

This commit is contained in:
Josh Groves 2020-04-13 12:00:37 -02:30 committed by GitHub
parent 2b128288c7
commit fc86589715
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
17 changed files with 832 additions and 67 deletions

View File

@ -435,6 +435,9 @@ GpuPipelineLayoutDescriptor = []
GpuPowerPreference = []
GpuPrimitiveTopology = []
GpuProgrammableStageDescriptor = []
GpuQuerySet = []
GpuQuerySetDescriptor = []
GpuQueryType = []
GpuQueue = []
GpuRasterizationStateDescriptor = []
GpuRenderBundle = []

View File

@ -23,10 +23,10 @@ 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 new(bindings: &::wasm_bindgen::JsValue, layout: &GpuBindGroupLayout) -> Self {
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.bindings(bindings);
ret.entries(entries);
ret.layout(layout);
ret
}
@ -48,17 +48,17 @@ impl GpuBindGroupDescriptor {
self
}
#[cfg(web_sys_unstable_apis)]
#[doc = "Change the `bindings` field of this object."]
#[doc = "Change 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)*"]
pub fn bindings(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self {
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("bindings"),
&JsValue::from("entries"),
&JsValue::from(val),
);
debug_assert!(

View File

@ -22,10 +22,10 @@ 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 new(bindings: &::wasm_bindgen::JsValue) -> Self {
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.bindings(bindings);
ret.entries(entries);
ret
}
#[cfg(web_sys_unstable_apis)]
@ -46,17 +46,17 @@ impl GpuBindGroupLayoutDescriptor {
self
}
#[cfg(web_sys_unstable_apis)]
#[doc = "Change the `bindings` field of this object."]
#[doc = "Change 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)*"]
pub fn bindings(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self {
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("bindings"),
&JsValue::from("entries"),
&JsValue::from(val),
);
debug_assert!(

View File

@ -23,11 +23,11 @@ impl GpuBufferCopyView {
#[doc = ""]
#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to 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, row_pitch: u32) -> Self {
pub fn new(buffer: &GpuBuffer, bytes_per_row: u32) -> Self {
#[allow(unused_mut)]
let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
ret.buffer(buffer);
ret.row_pitch(row_pitch);
ret.bytes_per_row(bytes_per_row);
ret
}
#[cfg(web_sys_unstable_apis)]
@ -50,17 +50,17 @@ impl GpuBufferCopyView {
self
}
#[cfg(web_sys_unstable_apis)]
#[doc = "Change the `imageHeight` field of this object."]
#[doc = "Change the `bytesPerRow` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `GpuBufferCopyView`*"]
#[doc = ""]
#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
pub fn image_height(&mut self, val: u32) -> &mut Self {
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("imageHeight"),
&JsValue::from("bytesPerRow"),
&JsValue::from(val),
);
debug_assert!(
@ -89,17 +89,17 @@ impl GpuBufferCopyView {
self
}
#[cfg(web_sys_unstable_apis)]
#[doc = "Change the `rowPitch` field of this object."]
#[doc = "Change the `rowsPerImage` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `GpuBufferCopyView`*"]
#[doc = ""]
#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
pub fn row_pitch(&mut self, val: u32) -> &mut Self {
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("rowPitch"),
&JsValue::from("rowsPerImage"),
&JsValue::from(val),
);
debug_assert!(

View File

@ -90,4 +90,12 @@ impl GpuBufferUsage {
#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
pub const INDIRECT: u32 = 256u64 as u32;
#[cfg(web_sys_unstable_apis)]
#[doc = "The `GPUBufferUsage.QUERY_RESOLVE` const."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `GpuBufferUsage`*"]
#[doc = ""]
#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
pub const QUERY_RESOLVE: u32 = 512u64 as u32;
}

View File

@ -404,4 +404,42 @@ 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 fn push_debug_group(this: &GpuCommandEncoder, group_label: &str);
#[cfg(web_sys_unstable_apis)]
#[cfg(all(feature = "GpuBuffer", feature = "GpuQuerySet",))]
# [ wasm_bindgen ( method , structural , js_class = "GPUCommandEncoder" , js_name = resolveQuerySet ) ]
#[doc = "The `resolveQuerySet()` method."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUCommandEncoder/resolveQuerySet)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `GpuBuffer`, `GpuCommandEncoder`, `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 resolve_query_set_with_u32(
this: &GpuCommandEncoder,
query_set: &GpuQuerySet,
first_query: u32,
query_count: u32,
destination: &GpuBuffer,
destination_offset: u32,
);
#[cfg(web_sys_unstable_apis)]
#[cfg(all(feature = "GpuBuffer", feature = "GpuQuerySet",))]
# [ wasm_bindgen ( method , structural , js_class = "GPUCommandEncoder" , js_name = resolveQuerySet ) ]
#[doc = "The `resolveQuerySet()` method."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUCommandEncoder/resolveQuerySet)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `GpuBuffer`, `GpuCommandEncoder`, `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 resolve_query_set_with_f64(
this: &GpuCommandEncoder,
query_set: &GpuQuerySet,
first_query: u32,
query_count: u32,
destination: &GpuBuffer,
destination_offset: f64,
);
}

View File

@ -224,6 +224,18 @@ extern "C" {
descriptor: &GpuPipelineLayoutDescriptor,
) -> GpuPipelineLayout;
#[cfg(web_sys_unstable_apis)]
#[cfg(all(feature = "GpuQuerySet", feature = "GpuQuerySetDescriptor",))]
# [ wasm_bindgen ( 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)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `GpuDevice`, `GpuQuerySet`, `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 create_query_set(this: &GpuDevice, descriptor: &GpuQuerySetDescriptor) -> GpuQuerySet;
#[cfg(web_sys_unstable_apis)]
#[cfg(all(
feature = "GpuRenderBundleEncoder",
feature = "GpuRenderBundleEncoderDescriptor",

View File

@ -0,0 +1,51 @@
#![allow(unused_imports)]
use super::*;
use wasm_bindgen::prelude::*;
#[cfg(web_sys_unstable_apis)]
#[wasm_bindgen]
extern "C" {
# [ wasm_bindgen ( extends = :: js_sys :: Object , js_name = GPUQuerySet , typescript_type = "GPUQuerySet" ) ]
#[derive(Debug, Clone, PartialEq, Eq)]
#[doc = "The `GpuQuerySet` class."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUQuerySet)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `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 type GpuQuerySet;
#[cfg(web_sys_unstable_apis)]
# [ wasm_bindgen ( structural , method , getter , js_class = "GPUQuerySet" , js_name = label ) ]
#[doc = "Getter for the `label` field of this object."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUQuerySet/label)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `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 label(this: &GpuQuerySet) -> Option<String>;
#[cfg(web_sys_unstable_apis)]
# [ wasm_bindgen ( structural , method , setter , js_class = "GPUQuerySet" , js_name = label ) ]
#[doc = "Setter for the `label` field of this object."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUQuerySet/label)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `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 set_label(this: &GpuQuerySet, value: Option<&str>);
#[cfg(web_sys_unstable_apis)]
# [ wasm_bindgen ( method , structural , js_class = "GPUQuerySet" , js_name = destroy ) ]
#[doc = "The `destroy()` method."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUQuerySet/destroy)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `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 destroy(this: &GpuQuerySet);
}

View File

@ -0,0 +1,85 @@
#![allow(unused_imports)]
use super::*;
use wasm_bindgen::prelude::*;
#[cfg(web_sys_unstable_apis)]
#[wasm_bindgen]
extern "C" {
# [ wasm_bindgen ( extends = :: js_sys :: Object , js_name = GPUQuerySetDescriptor ) ]
#[derive(Debug, Clone, PartialEq, Eq)]
#[doc = "The `GpuQuerySetDescriptor` dictionary."]
#[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)*"]
pub type GpuQuerySetDescriptor;
}
#[cfg(web_sys_unstable_apis)]
impl GpuQuerySetDescriptor {
#[cfg(feature = "GpuQueryType")]
#[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.count(count);
ret.type_(type_);
ret
}
#[cfg(web_sys_unstable_apis)]
#[doc = "Change the `label` 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)*"]
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
}
#[cfg(web_sys_unstable_apis)]
#[doc = "Change 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)*"]
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
}
#[cfg(web_sys_unstable_apis)]
#[cfg(feature = "GpuQueryType")]
#[doc = "Change 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)*"]
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
}
}

View File

@ -0,0 +1,14 @@
#![allow(unused_imports)]
use wasm_bindgen::prelude::*;
#[cfg(web_sys_unstable_apis)]
#[wasm_bindgen]
#[doc = "The `GpuQueryType` enum."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `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)*"]
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum GpuQueryType {
Occlusion = "occlusion",
}

View File

@ -174,7 +174,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 draw(
pub fn draw(this: &GpuRenderBundleEncoder, vertex_count: u32);
#[cfg(web_sys_unstable_apis)]
# [ wasm_bindgen ( method , structural , js_class = "GPURenderBundleEncoder" , js_name = draw ) ]
#[doc = "The `draw()` method."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPURenderBundleEncoder/draw)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `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 draw_with_instance_count(
this: &GpuRenderBundleEncoder,
vertex_count: u32,
instance_count: u32,
);
#[cfg(web_sys_unstable_apis)]
# [ wasm_bindgen ( method , structural , js_class = "GPURenderBundleEncoder" , js_name = draw ) ]
#[doc = "The `draw()` method."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPURenderBundleEncoder/draw)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `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 draw_with_instance_count_and_first_vertex(
this: &GpuRenderBundleEncoder,
vertex_count: u32,
instance_count: u32,
first_vertex: u32,
);
#[cfg(web_sys_unstable_apis)]
# [ wasm_bindgen ( method , structural , js_class = "GPURenderBundleEncoder" , js_name = draw ) ]
#[doc = "The `draw()` method."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPURenderBundleEncoder/draw)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `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 draw_with_instance_count_and_first_vertex_and_first_instance(
this: &GpuRenderBundleEncoder,
vertex_count: u32,
instance_count: u32,
@ -191,7 +233,66 @@ 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 draw_indexed(
pub fn draw_indexed(this: &GpuRenderBundleEncoder, index_count: u32);
#[cfg(web_sys_unstable_apis)]
# [ wasm_bindgen ( method , structural , js_class = "GPURenderBundleEncoder" , js_name = drawIndexed ) ]
#[doc = "The `drawIndexed()` method."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPURenderBundleEncoder/drawIndexed)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `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 draw_indexed_with_instance_count(
this: &GpuRenderBundleEncoder,
index_count: u32,
instance_count: u32,
);
#[cfg(web_sys_unstable_apis)]
# [ wasm_bindgen ( method , structural , js_class = "GPURenderBundleEncoder" , js_name = drawIndexed ) ]
#[doc = "The `drawIndexed()` method."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPURenderBundleEncoder/drawIndexed)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `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 draw_indexed_with_instance_count_and_first_index(
this: &GpuRenderBundleEncoder,
index_count: u32,
instance_count: u32,
first_index: u32,
);
#[cfg(web_sys_unstable_apis)]
# [ wasm_bindgen ( method , structural , js_class = "GPURenderBundleEncoder" , js_name = drawIndexed ) ]
#[doc = "The `drawIndexed()` method."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPURenderBundleEncoder/drawIndexed)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `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 draw_indexed_with_instance_count_and_first_index_and_base_vertex(
this: &GpuRenderBundleEncoder,
index_count: u32,
instance_count: u32,
first_index: u32,
base_vertex: i32,
);
#[cfg(web_sys_unstable_apis)]
# [ wasm_bindgen ( method , structural , js_class = "GPURenderBundleEncoder" , js_name = drawIndexed ) ]
#[doc = "The `drawIndexed()` method."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPURenderBundleEncoder/drawIndexed)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `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 draw_indexed_with_instance_count_and_first_index_and_base_vertex_and_first_instance(
this: &GpuRenderBundleEncoder,
index_count: u32,
instance_count: u32,
@ -308,6 +409,74 @@ extern "C" {
offset: f64,
);
#[cfg(web_sys_unstable_apis)]
#[cfg(feature = "GpuBuffer")]
# [ wasm_bindgen ( method , structural , js_class = "GPURenderBundleEncoder" , js_name = setIndexBuffer ) ]
#[doc = "The `setIndexBuffer()` method."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPURenderBundleEncoder/setIndexBuffer)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `GpuBuffer`, `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_index_buffer_with_u32_and_u32(
this: &GpuRenderBundleEncoder,
buffer: &GpuBuffer,
offset: u32,
size: u32,
);
#[cfg(web_sys_unstable_apis)]
#[cfg(feature = "GpuBuffer")]
# [ wasm_bindgen ( method , structural , js_class = "GPURenderBundleEncoder" , js_name = setIndexBuffer ) ]
#[doc = "The `setIndexBuffer()` method."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPURenderBundleEncoder/setIndexBuffer)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `GpuBuffer`, `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_index_buffer_with_f64_and_u32(
this: &GpuRenderBundleEncoder,
buffer: &GpuBuffer,
offset: f64,
size: u32,
);
#[cfg(web_sys_unstable_apis)]
#[cfg(feature = "GpuBuffer")]
# [ wasm_bindgen ( method , structural , js_class = "GPURenderBundleEncoder" , js_name = setIndexBuffer ) ]
#[doc = "The `setIndexBuffer()` method."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPURenderBundleEncoder/setIndexBuffer)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `GpuBuffer`, `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_index_buffer_with_u32_and_f64(
this: &GpuRenderBundleEncoder,
buffer: &GpuBuffer,
offset: u32,
size: f64,
);
#[cfg(web_sys_unstable_apis)]
#[cfg(feature = "GpuBuffer")]
# [ wasm_bindgen ( method , structural , js_class = "GPURenderBundleEncoder" , js_name = setIndexBuffer ) ]
#[doc = "The `setIndexBuffer()` method."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPURenderBundleEncoder/setIndexBuffer)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `GpuBuffer`, `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_index_buffer_with_f64_and_f64(
this: &GpuRenderBundleEncoder,
buffer: &GpuBuffer,
offset: f64,
size: f64,
);
#[cfg(web_sys_unstable_apis)]
#[cfg(feature = "GpuRenderPipeline")]
# [ wasm_bindgen ( method , structural , js_class = "GPURenderBundleEncoder" , js_name = setPipeline ) ]
#[doc = "The `setPipeline()` method."]
@ -365,4 +534,76 @@ extern "C" {
buffer: &GpuBuffer,
offset: f64,
);
#[cfg(web_sys_unstable_apis)]
#[cfg(feature = "GpuBuffer")]
# [ wasm_bindgen ( method , structural , js_class = "GPURenderBundleEncoder" , js_name = setVertexBuffer ) ]
#[doc = "The `setVertexBuffer()` method."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPURenderBundleEncoder/setVertexBuffer)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `GpuBuffer`, `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_vertex_buffer_with_u32_and_u32(
this: &GpuRenderBundleEncoder,
slot: u32,
buffer: &GpuBuffer,
offset: u32,
size: u32,
);
#[cfg(web_sys_unstable_apis)]
#[cfg(feature = "GpuBuffer")]
# [ wasm_bindgen ( method , structural , js_class = "GPURenderBundleEncoder" , js_name = setVertexBuffer ) ]
#[doc = "The `setVertexBuffer()` method."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPURenderBundleEncoder/setVertexBuffer)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `GpuBuffer`, `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_vertex_buffer_with_f64_and_u32(
this: &GpuRenderBundleEncoder,
slot: u32,
buffer: &GpuBuffer,
offset: f64,
size: u32,
);
#[cfg(web_sys_unstable_apis)]
#[cfg(feature = "GpuBuffer")]
# [ wasm_bindgen ( method , structural , js_class = "GPURenderBundleEncoder" , js_name = setVertexBuffer ) ]
#[doc = "The `setVertexBuffer()` method."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPURenderBundleEncoder/setVertexBuffer)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `GpuBuffer`, `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_vertex_buffer_with_u32_and_f64(
this: &GpuRenderBundleEncoder,
slot: u32,
buffer: &GpuBuffer,
offset: u32,
size: f64,
);
#[cfg(web_sys_unstable_apis)]
#[cfg(feature = "GpuBuffer")]
# [ wasm_bindgen ( method , structural , js_class = "GPURenderBundleEncoder" , js_name = setVertexBuffer ) ]
#[doc = "The `setVertexBuffer()` method."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPURenderBundleEncoder/setVertexBuffer)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `GpuBuffer`, `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_vertex_buffer_with_f64_and_f64(
this: &GpuRenderBundleEncoder,
slot: u32,
buffer: &GpuBuffer,
offset: f64,
size: f64,
);
}

View File

@ -91,4 +91,26 @@ impl GpuRenderPassDescriptor {
let _ = r;
self
}
#[cfg(web_sys_unstable_apis)]
#[cfg(feature = "GpuQuerySet")]
#[doc = "Change 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)*"]
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
}
}

View File

@ -38,6 +38,28 @@ 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: &GpuRenderPassEncoder, value: Option<&str>);
#[cfg(web_sys_unstable_apis)]
# [ wasm_bindgen ( method , structural , js_class = "GPURenderPassEncoder" , js_name = beginOcclusionQuery ) ]
#[doc = "The `beginOcclusionQuery()` method."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPURenderPassEncoder/beginOcclusionQuery)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `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 begin_occlusion_query(this: &GpuRenderPassEncoder, query_index: u32);
#[cfg(web_sys_unstable_apis)]
# [ wasm_bindgen ( method , structural , js_class = "GPURenderPassEncoder" , js_name = endOcclusionQuery ) ]
#[doc = "The `endOcclusionQuery()` method."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPURenderPassEncoder/endOcclusionQuery)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `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 end_occlusion_query(this: &GpuRenderPassEncoder, query_index: u32);
#[cfg(web_sys_unstable_apis)]
# [ wasm_bindgen ( method , structural , js_class = "GPURenderPassEncoder" , js_name = endPass ) ]
#[doc = "The `endPass()` method."]
#[doc = ""]
@ -236,7 +258,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 draw(
pub fn draw(this: &GpuRenderPassEncoder, vertex_count: u32);
#[cfg(web_sys_unstable_apis)]
# [ wasm_bindgen ( method , structural , js_class = "GPURenderPassEncoder" , js_name = draw ) ]
#[doc = "The `draw()` method."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPURenderPassEncoder/draw)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `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 draw_with_instance_count(
this: &GpuRenderPassEncoder,
vertex_count: u32,
instance_count: u32,
);
#[cfg(web_sys_unstable_apis)]
# [ wasm_bindgen ( method , structural , js_class = "GPURenderPassEncoder" , js_name = draw ) ]
#[doc = "The `draw()` method."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPURenderPassEncoder/draw)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `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 draw_with_instance_count_and_first_vertex(
this: &GpuRenderPassEncoder,
vertex_count: u32,
instance_count: u32,
first_vertex: u32,
);
#[cfg(web_sys_unstable_apis)]
# [ wasm_bindgen ( method , structural , js_class = "GPURenderPassEncoder" , js_name = draw ) ]
#[doc = "The `draw()` method."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPURenderPassEncoder/draw)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `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 draw_with_instance_count_and_first_vertex_and_first_instance(
this: &GpuRenderPassEncoder,
vertex_count: u32,
instance_count: u32,
@ -253,7 +317,66 @@ 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 draw_indexed(
pub fn draw_indexed(this: &GpuRenderPassEncoder, index_count: u32);
#[cfg(web_sys_unstable_apis)]
# [ wasm_bindgen ( method , structural , js_class = "GPURenderPassEncoder" , js_name = drawIndexed ) ]
#[doc = "The `drawIndexed()` method."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPURenderPassEncoder/drawIndexed)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `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 draw_indexed_with_instance_count(
this: &GpuRenderPassEncoder,
index_count: u32,
instance_count: u32,
);
#[cfg(web_sys_unstable_apis)]
# [ wasm_bindgen ( method , structural , js_class = "GPURenderPassEncoder" , js_name = drawIndexed ) ]
#[doc = "The `drawIndexed()` method."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPURenderPassEncoder/drawIndexed)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `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 draw_indexed_with_instance_count_and_first_index(
this: &GpuRenderPassEncoder,
index_count: u32,
instance_count: u32,
first_index: u32,
);
#[cfg(web_sys_unstable_apis)]
# [ wasm_bindgen ( method , structural , js_class = "GPURenderPassEncoder" , js_name = drawIndexed ) ]
#[doc = "The `drawIndexed()` method."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPURenderPassEncoder/drawIndexed)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `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 draw_indexed_with_instance_count_and_first_index_and_base_vertex(
this: &GpuRenderPassEncoder,
index_count: u32,
instance_count: u32,
first_index: u32,
base_vertex: i32,
);
#[cfg(web_sys_unstable_apis)]
# [ wasm_bindgen ( method , structural , js_class = "GPURenderPassEncoder" , js_name = drawIndexed ) ]
#[doc = "The `drawIndexed()` method."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPURenderPassEncoder/drawIndexed)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `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 draw_indexed_with_instance_count_and_first_index_and_base_vertex_and_first_instance(
this: &GpuRenderPassEncoder,
index_count: u32,
instance_count: u32,
@ -362,6 +485,74 @@ extern "C" {
#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
pub fn set_index_buffer_with_f64(this: &GpuRenderPassEncoder, buffer: &GpuBuffer, offset: f64);
#[cfg(web_sys_unstable_apis)]
#[cfg(feature = "GpuBuffer")]
# [ wasm_bindgen ( method , structural , js_class = "GPURenderPassEncoder" , js_name = setIndexBuffer ) ]
#[doc = "The `setIndexBuffer()` method."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPURenderPassEncoder/setIndexBuffer)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `GpuBuffer`, `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_index_buffer_with_u32_and_u32(
this: &GpuRenderPassEncoder,
buffer: &GpuBuffer,
offset: u32,
size: u32,
);
#[cfg(web_sys_unstable_apis)]
#[cfg(feature = "GpuBuffer")]
# [ wasm_bindgen ( method , structural , js_class = "GPURenderPassEncoder" , js_name = setIndexBuffer ) ]
#[doc = "The `setIndexBuffer()` method."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPURenderPassEncoder/setIndexBuffer)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `GpuBuffer`, `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_index_buffer_with_f64_and_u32(
this: &GpuRenderPassEncoder,
buffer: &GpuBuffer,
offset: f64,
size: u32,
);
#[cfg(web_sys_unstable_apis)]
#[cfg(feature = "GpuBuffer")]
# [ wasm_bindgen ( method , structural , js_class = "GPURenderPassEncoder" , js_name = setIndexBuffer ) ]
#[doc = "The `setIndexBuffer()` method."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPURenderPassEncoder/setIndexBuffer)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `GpuBuffer`, `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_index_buffer_with_u32_and_f64(
this: &GpuRenderPassEncoder,
buffer: &GpuBuffer,
offset: u32,
size: f64,
);
#[cfg(web_sys_unstable_apis)]
#[cfg(feature = "GpuBuffer")]
# [ wasm_bindgen ( method , structural , js_class = "GPURenderPassEncoder" , js_name = setIndexBuffer ) ]
#[doc = "The `setIndexBuffer()` method."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPURenderPassEncoder/setIndexBuffer)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `GpuBuffer`, `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_index_buffer_with_f64_and_f64(
this: &GpuRenderPassEncoder,
buffer: &GpuBuffer,
offset: f64,
size: f64,
);
#[cfg(web_sys_unstable_apis)]
#[cfg(feature = "GpuRenderPipeline")]
# [ wasm_bindgen ( method , structural , js_class = "GPURenderPassEncoder" , js_name = setPipeline ) ]
#[doc = "The `setPipeline()` method."]
@ -419,4 +610,76 @@ extern "C" {
buffer: &GpuBuffer,
offset: f64,
);
#[cfg(web_sys_unstable_apis)]
#[cfg(feature = "GpuBuffer")]
# [ wasm_bindgen ( method , structural , js_class = "GPURenderPassEncoder" , js_name = setVertexBuffer ) ]
#[doc = "The `setVertexBuffer()` method."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPURenderPassEncoder/setVertexBuffer)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `GpuBuffer`, `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_vertex_buffer_with_u32_and_u32(
this: &GpuRenderPassEncoder,
slot: u32,
buffer: &GpuBuffer,
offset: u32,
size: u32,
);
#[cfg(web_sys_unstable_apis)]
#[cfg(feature = "GpuBuffer")]
# [ wasm_bindgen ( method , structural , js_class = "GPURenderPassEncoder" , js_name = setVertexBuffer ) ]
#[doc = "The `setVertexBuffer()` method."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPURenderPassEncoder/setVertexBuffer)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `GpuBuffer`, `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_vertex_buffer_with_f64_and_u32(
this: &GpuRenderPassEncoder,
slot: u32,
buffer: &GpuBuffer,
offset: f64,
size: u32,
);
#[cfg(web_sys_unstable_apis)]
#[cfg(feature = "GpuBuffer")]
# [ wasm_bindgen ( method , structural , js_class = "GPURenderPassEncoder" , js_name = setVertexBuffer ) ]
#[doc = "The `setVertexBuffer()` method."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPURenderPassEncoder/setVertexBuffer)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `GpuBuffer`, `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_vertex_buffer_with_u32_and_f64(
this: &GpuRenderPassEncoder,
slot: u32,
buffer: &GpuBuffer,
offset: u32,
size: f64,
);
#[cfg(web_sys_unstable_apis)]
#[cfg(feature = "GpuBuffer")]
# [ wasm_bindgen ( method , structural , js_class = "GPURenderPassEncoder" , js_name = setVertexBuffer ) ]
#[doc = "The `setVertexBuffer()` method."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPURenderPassEncoder/setVertexBuffer)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `GpuBuffer`, `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_vertex_buffer_with_f64_and_f64(
this: &GpuRenderPassEncoder,
slot: u32,
buffer: &GpuBuffer,
offset: f64,
size: f64,
);
}

View File

@ -22,7 +22,7 @@ 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 new(code: &str) -> Self {
pub fn new(code: &::wasm_bindgen::JsValue) -> Self {
#[allow(unused_mut)]
let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
ret.code(code);
@ -52,7 +52,7 @@ 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 {
pub fn code(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self {
use wasm_bindgen::JsValue;
let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("code"), &JsValue::from(val));
debug_assert!(

View File

@ -49,27 +49,6 @@ impl GpuTextureDescriptor {
self
}
#[cfg(web_sys_unstable_apis)]
#[doc = "Change the `arrayLayerCount` 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)*"]
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
}
#[cfg(web_sys_unstable_apis)]
#[cfg(feature = "GpuTextureDimension")]
#[doc = "Change the `dimension` field of this object."]
#[doc = ""]

View File

@ -2428,6 +2428,24 @@ mod gen_GpuProgrammableStageDescriptor;
#[cfg(feature = "GpuProgrammableStageDescriptor")]
pub use gen_GpuProgrammableStageDescriptor::*;
#[cfg(feature = "GpuQuerySet")]
#[allow(non_snake_case)]
mod gen_GpuQuerySet;
#[cfg(feature = "GpuQuerySet")]
pub use gen_GpuQuerySet::*;
#[cfg(feature = "GpuQuerySetDescriptor")]
#[allow(non_snake_case)]
mod gen_GpuQuerySetDescriptor;
#[cfg(feature = "GpuQuerySetDescriptor")]
pub use gen_GpuQuerySetDescriptor::*;
#[cfg(feature = "GpuQueryType")]
#[allow(non_snake_case)]
mod gen_GpuQueryType;
#[cfg(feature = "GpuQueryType")]
pub use gen_GpuQueryType::*;
#[cfg(feature = "GpuQueue")]
#[allow(non_snake_case)]
mod gen_GpuQueue;

View File

@ -81,6 +81,8 @@ interface GPUDevice : EventTarget {
GPUCommandEncoder createCommandEncoder(optional GPUCommandEncoderDescriptor descriptor = {});
GPURenderBundleEncoder createRenderBundleEncoder(GPURenderBundleEncoderDescriptor descriptor);
GPUQuerySet createQuerySet(GPUQuerySetDescriptor descriptor);
};
GPUDevice includes GPUObjectBase;
@ -101,15 +103,16 @@ dictionary GPUBufferDescriptor : GPUObjectDescriptorBase {
typedef [EnforceRange] unsigned long GPUBufferUsageFlags;
interface GPUBufferUsage {
const GPUBufferUsageFlags MAP_READ = 0x0001;
const GPUBufferUsageFlags MAP_WRITE = 0x0002;
const GPUBufferUsageFlags COPY_SRC = 0x0004;
const GPUBufferUsageFlags COPY_DST = 0x0008;
const GPUBufferUsageFlags INDEX = 0x0010;
const GPUBufferUsageFlags VERTEX = 0x0020;
const GPUBufferUsageFlags UNIFORM = 0x0040;
const GPUBufferUsageFlags STORAGE = 0x0080;
const GPUBufferUsageFlags INDIRECT = 0x0100;
const GPUBufferUsageFlags MAP_READ = 0x0001;
const GPUBufferUsageFlags MAP_WRITE = 0x0002;
const GPUBufferUsageFlags COPY_SRC = 0x0004;
const GPUBufferUsageFlags COPY_DST = 0x0008;
const GPUBufferUsageFlags INDEX = 0x0010;
const GPUBufferUsageFlags VERTEX = 0x0020;
const GPUBufferUsageFlags UNIFORM = 0x0040;
const GPUBufferUsageFlags STORAGE = 0x0080;
const GPUBufferUsageFlags INDIRECT = 0x0100;
const GPUBufferUsageFlags QUERY_RESOLVE = 0x0200;
};
[Serializable]
@ -122,7 +125,6 @@ GPUTexture includes GPUObjectBase;
dictionary GPUTextureDescriptor : GPUObjectDescriptorBase {
required GPUExtent3D size;
GPUIntegerCoordinate arrayLayerCount = 1;
GPUIntegerCoordinate mipLevelCount = 1;
GPUSize32 sampleCount = 1;
GPUTextureDimension dimension = "2d";
@ -277,7 +279,7 @@ interface GPUBindGroupLayout {
GPUBindGroupLayout includes GPUObjectBase;
dictionary GPUBindGroupLayoutDescriptor : GPUObjectDescriptorBase {
required sequence<GPUBindGroupLayoutEntry> bindings;
required sequence<GPUBindGroupLayoutEntry> entries;
};
dictionary GPUBindGroupLayoutEntry {
@ -286,9 +288,9 @@ dictionary GPUBindGroupLayoutEntry {
required GPUBindingType type;
GPUTextureViewDimension viewDimension = "2d";
GPUTextureComponentType textureComponentType = "float";
GPUTextureFormat storageTextureFormat;
boolean multisampled = false;
boolean hasDynamicOffset = false;
GPUTextureFormat storageTextureFormat;
};
typedef [EnforceRange] unsigned long GPUShaderStageFlags;
@ -316,7 +318,7 @@ GPUBindGroup includes GPUObjectBase;
dictionary GPUBindGroupDescriptor : GPUObjectDescriptorBase {
required GPUBindGroupLayout layout;
required sequence<GPUBindGroupEntry> bindings;
required sequence<GPUBindGroupEntry> entries;
};
typedef (GPUSampler or GPUTextureView or GPUBufferBinding) GPUBindingResource;
@ -345,8 +347,10 @@ interface GPUShaderModule {
};
GPUShaderModule includes GPUObjectBase;
typedef (DOMString or Uint32Array) GPUCode;
dictionary GPUShaderModuleDescriptor : GPUObjectDescriptorBase {
required DOMString code;
required GPUCode code;
};
dictionary GPUPipelineDescriptorBase : GPUObjectDescriptorBase {
@ -593,6 +597,13 @@ interface GPUCommandEncoder {
void popDebugGroup();
void insertDebugMarker(DOMString markerLabel);
void resolveQuerySet(
GPUQuerySet querySet,
GPUSize32 firstQuery,
GPUSize32 queryCount,
GPUBuffer destination,
GPUSize64 destinationOffset);
GPUCommandBuffer finish(optional GPUCommandBufferDescriptor descriptor = {});
};
GPUCommandEncoder includes GPUObjectBase;
@ -604,8 +615,8 @@ dictionary GPUCommandEncoderDescriptor : GPUObjectDescriptorBase {
dictionary GPUBufferCopyView {
required GPUBuffer buffer;
GPUSize64 offset = 0;
required GPUSize32 rowPitch;
GPUSize32 imageHeight = 0;
required GPUSize32 bytesPerRow;
GPUSize32 rowsPerImage = 0;
};
dictionary GPUTextureCopyView {
@ -650,13 +661,15 @@ dictionary GPUComputePassDescriptor : GPUObjectDescriptorBase {
interface mixin GPURenderEncoderBase {
void setPipeline(GPURenderPipeline pipeline);
void setIndexBuffer(GPUBuffer buffer, optional GPUSize64 offset = 0);
void setVertexBuffer(GPUIndex32 slot, GPUBuffer buffer, optional GPUSize64 offset = 0);
void setIndexBuffer(GPUBuffer buffer, optional GPUSize64 offset = 0, optional GPUSize64 size = 0);
void setVertexBuffer(GPUIndex32 slot, GPUBuffer buffer, optional GPUSize64 offset = 0, optional GPUSize64 size = 0);
void draw(GPUSize32 vertexCount, GPUSize32 instanceCount,
GPUSize32 firstVertex, GPUSize32 firstInstance);
void drawIndexed(GPUSize32 indexCount, GPUSize32 instanceCount,
GPUSize32 firstIndex, GPUSignedOffset32 baseVertex, GPUSize32 firstInstance);
void draw(GPUSize32 vertexCount, optional GPUSize32 instanceCount = 1,
optional GPUSize32 firstVertex = 0, optional GPUSize32 firstInstance = 0);
void drawIndexed(GPUSize32 indexCount, optional GPUSize32 instanceCount = 1,
optional GPUSize32 firstIndex = 0,
optional GPUSignedOffset32 baseVertex = 0,
optional GPUSize32 firstInstance = 0);
void drawIndirect(GPUBuffer indirectBuffer, GPUSize64 indirectOffset);
void drawIndexedIndirect(GPUBuffer indirectBuffer, GPUSize64 indirectOffset);
@ -673,6 +686,9 @@ interface GPURenderPassEncoder {
void setBlendColor(GPUColor color);
void setStencilReference(GPUStencilValue reference);
void beginOcclusionQuery(GPUSize32 queryIndex);
void endOcclusionQuery(GPUSize32 queryIndex);
void executeBundles(sequence<GPURenderBundle> bundles);
void endPass();
};
@ -683,6 +699,7 @@ GPURenderPassEncoder includes GPURenderEncoderBase;
dictionary GPURenderPassDescriptor : GPUObjectDescriptorBase {
required sequence<GPURenderPassColorAttachmentDescriptor> colorAttachments;
GPURenderPassDepthStencilAttachmentDescriptor depthStencilAttachment;
GPUQuerySet occlusionQuerySet;
};
dictionary GPURenderPassColorAttachmentDescriptor {
@ -755,6 +772,20 @@ dictionary GPUFenceDescriptor : GPUObjectDescriptorBase {
GPUFenceValue initialValue = 0;
};
interface GPUQuerySet {
void destroy();
};
GPUQuerySet includes GPUObjectBase;
dictionary GPUQuerySetDescriptor : GPUObjectDescriptorBase {
required GPUQueryType type;
required GPUSize32 count;
};
enum GPUQueryType {
"occlusion"
};
interface GPUCanvasContext {
GPUSwapChain configureSwapChain(GPUSwapChainDescriptor descriptor);