Skip to content

Commit 55bc503

Browse files
WIP: chore!: update web-sys to rustwasm/wasm-bindgen#3816
TODO: merge PR in upstream, consume the "good" way here
1 parent 3c31244 commit 55bc503

File tree

3 files changed

+20
-28
lines changed

3 files changed

+20
-28
lines changed

Cargo.lock

Lines changed: 7 additions & 14 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -183,9 +183,10 @@ termcolor = "1.4.1"
183183

184184
[patch.crates-io]
185185
#glow = { path = "../glow" }
186-
#web-sys = { path = "../wasm-bindgen/crates/web-sys" }
187-
#js-sys = { path = "../wasm-bindgen/crates/js-sys" }
188-
#wasm-bindgen = { path = "../wasm-bindgen" }
186+
# Merge commit generated from <https://github.com/rustwasm/wasm-bindgen/pull/3816>.
187+
web-sys = { version = "0.3.67", git = "https://github.com/rustwasm/wasm-bindgen", rev = "b1047882dcc3ac984485a518b1899670efcc3aa8" }
188+
js-sys = { version = "0.3.67", git = "https://github.com/rustwasm/wasm-bindgen", rev = "b1047882dcc3ac984485a518b1899670efcc3aa8" }
189+
wasm-bindgen = { version = "0.2.9", git = "https://github.com/rustwasm/wasm-bindgen", rev = "b1047882dcc3ac984485a518b1899670efcc3aa8" }
189190

190191
# Speed up image comparison even in debug builds
191192
[profile.dev.package."nv-flip-sys"]

wgpu/src/backend/webgpu.rs

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -372,11 +372,9 @@ fn map_stencil_state_face(desc: &wgt::StencilFaceState) -> web_sys::GpuStencilFa
372372
}
373373

374374
fn map_depth_stencil_state(desc: &wgt::DepthStencilState) -> web_sys::GpuDepthStencilState {
375-
let mut mapped = web_sys::GpuDepthStencilState::new(
376-
map_compare_function(desc.depth_compare),
377-
desc.depth_write_enabled,
378-
map_texture_format(desc.format),
379-
);
375+
let mut mapped = web_sys::GpuDepthStencilState::new(map_texture_format(desc.format));
376+
mapped.depth_write_enabled(desc.depth_write_enabled);
377+
mapped.depth_compare(map_compare_function(desc.depth_compare));
380378
mapped.depth_bias(desc.bias.constant);
381379
mapped.depth_bias_clamp(desc.bias.clamp);
382380
mapped.depth_bias_slope_scale(desc.bias.slope_scale);
@@ -1689,8 +1687,8 @@ impl crate::context::Context for ContextWebGpu {
16891687
) -> (Self::RenderPipelineId, Self::RenderPipelineData) {
16901688
let module: &<ContextWebGpu as crate::Context>::ShaderModuleData =
16911689
downcast_ref(desc.vertex.module.data.as_ref());
1692-
let mut mapped_vertex_state =
1693-
web_sys::GpuVertexState::new(desc.vertex.entry_point, &module.0);
1690+
let mut mapped_vertex_state = web_sys::GpuVertexState::new(&module.0);
1691+
mapped_vertex_state.entry_point(desc.vertex.entry_point);
16941692

16951693
let buffers = desc
16961694
.vertex
@@ -1764,8 +1762,8 @@ impl crate::context::Context for ContextWebGpu {
17641762
.collect::<js_sys::Array>();
17651763
let module: &<ContextWebGpu as crate::Context>::ShaderModuleData =
17661764
downcast_ref(frag.module.data.as_ref());
1767-
let mapped_fragment_desc =
1768-
web_sys::GpuFragmentState::new(frag.entry_point, &module.0, &targets);
1765+
let mapped_fragment_desc = web_sys::GpuFragmentState::new(&module.0, &targets);
1766+
mapped_fragment_desc.entry_point(frag.entry_point);
17691767
mapped_desc.fragment(&mapped_fragment_desc);
17701768
}
17711769

@@ -1789,8 +1787,8 @@ impl crate::context::Context for ContextWebGpu {
17891787
) -> (Self::ComputePipelineId, Self::ComputePipelineData) {
17901788
let shader_module: &<ContextWebGpu as crate::Context>::ShaderModuleData =
17911789
downcast_ref(desc.module.data.as_ref());
1792-
let mapped_compute_stage =
1793-
web_sys::GpuProgrammableStage::new(desc.entry_point, &shader_module.0);
1790+
let mapped_compute_stage = web_sys::GpuProgrammableStage::new(&shader_module.0);
1791+
mapped_compute_stage.entry_point(desc.entry_point);
17941792
let auto_layout = wasm_bindgen::JsValue::from(web_sys::GpuAutoLayoutMode::Auto);
17951793
let mut mapped_desc = web_sys::GpuComputePipelineDescriptor::new(
17961794
&match desc.layout {

0 commit comments

Comments
 (0)