From b16509ad7fede8786afa2aff54e4ce8602154fc0 Mon Sep 17 00:00:00 2001 From: Zakor Gyula Date: Mon, 13 Jan 2020 16:50:59 +0100 Subject: [PATCH] Update wgpu-core --- Cargo.lock | 74 +++++++++++++++++++++++++++++++++------- components/webgpu/lib.rs | 15 ++++---- servo-tidy.toml | 2 ++ 3 files changed, 71 insertions(+), 20 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index df3badcb5f6..9a6c904e824 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -206,9 +206,9 @@ dependencies = [ "lazy_static", "libc", "log", - "mach", + "mach 0.3.2", "msg", - "nix", + "nix 0.14.1", "serde_json", "unwind-sys", ] @@ -242,6 +242,23 @@ dependencies = [ "byteorder", ] +[[package]] +name = "battery" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "36a698e449024a5d18994a815998bf5e2e4bc1883e35a7d7ba95b6b69ee45907" +dependencies = [ + "cfg-if", + "core-foundation", + "lazycell", + "libc", + "mach 0.2.3", + "nix 0.15.0", + "num-traits", + "uom", + "winapi", +] + [[package]] name = "binary-space-partition" version = "0.1.2" @@ -833,9 +850,9 @@ checksum = "6ff9c56c9fb2a49c05ef0e431485a22400af20d33226dc0764d891d09e724127" [[package]] name = "core-foundation" -version = "0.6.2" +version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "58667b9a618a37ea8c4c4cb5298703e5dfadcd3698c79f54fc43e6a2e94733ea" +checksum = "25b9e03f145fd4f2bf705e07b900cd41fc636598fe5dc452fd0db1441c3f496d" dependencies = [ "core-foundation-sys", "libc", @@ -2878,9 +2895,9 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" [[package]] name = "lazycell" -version = "1.0.0" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d33a48d0365c96081958cc663eef834975cb1e8d8bea3378513fc72bdbf11e50" +checksum = "b294d6fa9ee409a054354afc4352b0b9ef7ca222c69b8812cbea9e7d2bf3783f" [[package]] name = "leak" @@ -3121,6 +3138,15 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c41e0c4fef86961ac6d6f8a82609f55f31b05e4fce149ac5710e439df7619ba4" +[[package]] +name = "mach" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "86dd2487cdfea56def77b88438a2c915fb45113c5319bfe7e14306ca4cd0b0e1" +dependencies = [ + "libc", +] + [[package]] name = "mach" version = "0.3.2" @@ -3595,6 +3621,19 @@ dependencies = [ "void", ] +[[package]] +name = "nix" +version = "0.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b2e0b4f3320ed72aaedb9a5ac838690a8047c7b275da22711fddff4f8a14229" +dependencies = [ + "bitflags", + "cc", + "cfg-if", + "libc", + "void", +] + [[package]] name = "nodrop" version = "0.1.12" @@ -5264,7 +5303,7 @@ dependencies = [ "dlib", "lazy_static", "memmap", - "nix", + "nix 0.14.1", "wayland-client", "wayland-commons", "wayland-protocols", @@ -5502,7 +5541,7 @@ dependencies = [ "lazy_static", "libc", "log", - "mach", + "mach 0.3.2", "objc", "osmesa-sys", "wayland-sys 0.24.0", @@ -5529,7 +5568,7 @@ dependencies = [ "lazy_static", "libc", "log", - "mach", + "mach 0.3.2", "objc", "parking_lot", "wayland-sys 0.24.0", @@ -6107,6 +6146,16 @@ dependencies = [ "pkg-config", ] +[[package]] +name = "uom" +version = "0.26.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4cec796ec5f7ac557631709079168286056205c51c60aac33f51764bdc7b8dc4" +dependencies = [ + "num-traits", + "typenum", +] + [[package]] name = "url" version = "2.1.0" @@ -6232,7 +6281,7 @@ dependencies = [ "bitflags", "downcast-rs", "libc", - "nix", + "nix 0.14.1", "wayland-commons", "wayland-scanner", "wayland-sys 0.21.13", @@ -6244,7 +6293,7 @@ version = "0.21.13" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "40c08896768b667e1df195d88a62a53a2d1351a1ed96188be79c196b35bb32ec" dependencies = [ - "nix", + "nix 0.14.1", "wayland-sys 0.21.13", ] @@ -6496,9 +6545,10 @@ dependencies = [ [[package]] name = "wgpu-core" version = "0.1.0" -source = "git+https://github.com/gfx-rs/wgpu#6b097ab77a33d012e06f128f47ce74440f692d9f" +source = "git+https://github.com/gfx-rs/wgpu#c0fa61a064c3572ee60d6c4c6a59ca0571394200" dependencies = [ "arrayvec 0.5.1", + "battery", "bitflags", "copyless", "fxhash", diff --git a/components/webgpu/lib.rs b/components/webgpu/lib.rs index 8ad053460bb..c177149c9c4 100644 --- a/components/webgpu/lib.rs +++ b/components/webgpu/lib.rs @@ -182,9 +182,9 @@ impl WGPU { }, WebGPURequest::CreateBuffer(sender, device, id, descriptor) => { let global = &self.global; - let _output = + let buffer_id = gfx_select!(id => global.device_create_buffer(device.0, &descriptor, id)); - let buffer = WebGPUBuffer(id); + let buffer = WebGPUBuffer(buffer_id); if let Err(e) = sender.send(buffer) { warn!( "Failed to send response to WebGPURequest::CreateBuffer ({})", @@ -194,12 +194,11 @@ impl WGPU { }, WebGPURequest::CreateBufferMapped(sender, device, id, descriptor) => { let global = &self.global; - let mut arr_buff_ptr: *mut u8 = std::ptr::null_mut(); let buffer_size = descriptor.size as usize; - let _output = gfx_select!(id => - global.device_create_buffer_mapped(device.0, &descriptor, &mut arr_buff_ptr, id)); - let buffer = WebGPUBuffer(id); + let (buffer_id, arr_buff_ptr) = gfx_select!(id => + global.device_create_buffer_mapped(device.0, &descriptor, id)); + let buffer = WebGPUBuffer(buffer_id); let mut array_buffer = Vec::with_capacity(buffer_size); unsafe { @@ -215,11 +214,11 @@ impl WGPU { }, WebGPURequest::UnmapBuffer(buffer) => { let global = &self.global; - let _output = gfx_select!(buffer.0 => global.buffer_unmap(buffer.0)); + gfx_select!(buffer.0 => global.buffer_unmap(buffer.0)); }, WebGPURequest::DestroyBuffer(buffer) => { let global = &self.global; - let _output = gfx_select!(buffer.0 => global.buffer_destroy(buffer.0)); + gfx_select!(buffer.0 => global.buffer_destroy(buffer.0)); }, WebGPURequest::Exit(sender) => { self.deinit(); diff --git a/servo-tidy.toml b/servo-tidy.toml index de8bd7e28ec..4b65de58f04 100644 --- a/servo-tidy.toml +++ b/servo-tidy.toml @@ -31,6 +31,8 @@ packages = [ "cgl", "cocoa", "gleam", + "mach", + "nix", "wayland-sys", # https://github.com/servo/servo/pull/23288#issuecomment-494687746