upgrade wgpu to v0.6

This commit is contained in:
Kunal Mohan 2020-08-21 22:07:02 +05:30
parent 669b16f2c0
commit e1bfc7aa0d
5 changed files with 125 additions and 41 deletions

151
Cargo.lock generated
View file

@ -726,6 +726,15 @@ dependencies = [
"bitflags", "bitflags",
] ]
[[package]]
name = "cloudabi"
version = "0.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4344512281c643ae7638bbabc3af17a11307803ec8f0fcad9fae512a8bf36467"
dependencies = [
"bitflags",
]
[[package]] [[package]]
name = "cmake" name = "cmake"
version = "0.1.44" version = "0.1.44"
@ -1911,9 +1920,9 @@ dependencies = [
[[package]] [[package]]
name = "gfx-auxil" name = "gfx-auxil"
version = "0.4.0" version = "0.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "67bdbf8e8d6883c70e5a0d7379ad8ab3ac95127a3761306b36122d8f1c177a8e" checksum = "6311ee3cc7a3b4c8ae94c4513cd2cbe888ec37990cf0ffa672bd275391b12eb1"
dependencies = [ dependencies = [
"fxhash", "fxhash",
"gfx-hal", "gfx-hal",
@ -1922,16 +1931,16 @@ dependencies = [
[[package]] [[package]]
name = "gfx-backend-dx11" name = "gfx-backend-dx11"
version = "0.5.1" version = "0.6.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "92de0ddc0fde1a89b2a0e92dcc6bbb554bd34af0135e53a28d5ef064611094a4" checksum = "de0a460b6458f3857af43064c687b1a010fe1f1b2e8c68fcd1d5db7206fa0809"
dependencies = [ dependencies = [
"bitflags", "bitflags",
"gfx-auxil", "gfx-auxil",
"gfx-hal", "gfx-hal",
"libloading 0.5.2", "libloading 0.6.1",
"log", "log",
"parking_lot 0.10.2", "parking_lot 0.11.0",
"range-alloc", "range-alloc",
"raw-window-handle", "raw-window-handle",
"smallvec 1.4.2", "smallvec 1.4.2",
@ -1942,9 +1951,9 @@ dependencies = [
[[package]] [[package]]
name = "gfx-backend-dx12" name = "gfx-backend-dx12"
version = "0.5.8" version = "0.6.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "05218b5c94539f22ac7d6feb4b2482431b89f6cc897132494701ac48619218d7" checksum = "c392af02ae88bc127abf94e1b88c817b7274d8d977aae986d5f2829392a30b0b"
dependencies = [ dependencies = [
"bitflags", "bitflags",
"d3d12", "d3d12",
@ -1960,19 +1969,20 @@ dependencies = [
[[package]] [[package]]
name = "gfx-backend-empty" name = "gfx-backend-empty"
version = "0.5.0" version = "0.6.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b67bd2d7bc022b257ddbdabc5fa3b10c29c292372c3409f2b6a6e3f4e11cdb85" checksum = "2085227c12b78f6657a900c829f2d0deb46a9be3eaf86844fde263cdc218f77c"
dependencies = [ dependencies = [
"gfx-hal", "gfx-hal",
"log",
"raw-window-handle", "raw-window-handle",
] ]
[[package]] [[package]]
name = "gfx-backend-metal" name = "gfx-backend-metal"
version = "0.5.6" version = "0.6.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "92804d20b194de6c84cb4bec14ec6a6dcae9c51f0a9186817fb412a590131ae6" checksum = "42518c5b571be5ba337a89cfba5abfaf2d90b83fc4db96357f64f2ea05f20f81"
dependencies = [ dependencies = [
"arrayvec 0.5.1", "arrayvec 0.5.1",
"bitflags", "bitflags",
@ -1986,7 +1996,7 @@ dependencies = [
"log", "log",
"metal 0.20.0", "metal 0.20.0",
"objc", "objc",
"parking_lot 0.10.2", "parking_lot 0.11.0",
"range-alloc", "range-alloc",
"raw-window-handle", "raw-window-handle",
"smallvec 1.4.2", "smallvec 1.4.2",
@ -1996,15 +2006,16 @@ dependencies = [
[[package]] [[package]]
name = "gfx-backend-vulkan" name = "gfx-backend-vulkan"
version = "0.5.11" version = "0.6.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "aec9c919cfc236d2c36aaa38609c1906a92f2df99a3c7f53022b01936f98275a" checksum = "a84bda4200a82e1912d575801e2bb76ae19c6256359afbc0adfbbaec02fcadc6"
dependencies = [ dependencies = [
"arrayvec 0.5.1", "arrayvec 0.5.1",
"ash", "ash",
"byteorder", "byteorder",
"core-graphics-types", "core-graphics-types",
"gfx-hal", "gfx-hal",
"inplace_it",
"lazy_static", "lazy_static",
"log", "log",
"objc", "objc",
@ -2015,9 +2026,11 @@ dependencies = [
[[package]] [[package]]
name = "gfx-descriptor" name = "gfx-descriptor"
version = "0.1.0" version = "0.2.0"
source = "git+https://github.com/gfx-rs/gfx-extras?rev=473a4cdc63463e7986707507c4a7f6a3a767e329#473a4cdc63463e7986707507c4a7f6a3a767e329" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cd8c7afcd000f279d541a490e27117e61037537279b9342279abf4938fe60c6b"
dependencies = [ dependencies = [
"arrayvec 0.5.1",
"fxhash", "fxhash",
"gfx-hal", "gfx-hal",
"log", "log",
@ -2025,9 +2038,9 @@ dependencies = [
[[package]] [[package]]
name = "gfx-hal" name = "gfx-hal"
version = "0.5.3" version = "0.6.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a18534b23d4c262916231511309bc1f307c74cda8dcb68b93a10ca213a22814b" checksum = "18d0754f5b7a43915fd7466883b2d1bb0800d7cc4609178d0b27bf143b9e5123"
dependencies = [ dependencies = [
"bitflags", "bitflags",
"raw-window-handle", "raw-window-handle",
@ -2035,8 +2048,9 @@ dependencies = [
[[package]] [[package]]
name = "gfx-memory" name = "gfx-memory"
version = "0.1.3" version = "0.2.0"
source = "git+https://github.com/gfx-rs/gfx-extras?rev=473a4cdc63463e7986707507c4a7f6a3a767e329#473a4cdc63463e7986707507c4a7f6a3a767e329" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fe8d8855df07f438eb8a765e90356d5b821d644ea3b59b870091450b89576a9f"
dependencies = [ dependencies = [
"fxhash", "fxhash",
"gfx-hal", "gfx-hal",
@ -2773,6 +2787,12 @@ dependencies = [
"hashbrown", "hashbrown",
] ]
[[package]]
name = "inplace_it"
version = "0.3.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "dd01a2a73f2f399df96b22dc88ea687ef4d76226284e7531ae3c7ee1dc5cb534"
[[package]] [[package]]
name = "input_buffer" name = "input_buffer"
version = "0.3.1" version = "0.3.1"
@ -2782,6 +2802,12 @@ dependencies = [
"bytes 0.5.5", "bytes 0.5.5",
] ]
[[package]]
name = "instant"
version = "0.1.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5b141fdc7836c525d4d594027d318c84161ca17aaf8113ab1f81ab93ae897485"
[[package]] [[package]]
name = "io-surface" name = "io-surface"
version = "0.12.1" version = "0.12.1"
@ -3137,9 +3163,9 @@ dependencies = [
[[package]] [[package]]
name = "libc" name = "libc"
version = "0.2.70" version = "0.2.76"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3baa92041a6fec78c687fa0cc2b3fae8884f743d672cf551bed1d6dac6988d0f" checksum = "755456fae044e6fa1ebbbd1b3e902ae19e73097ed4ed87bb79934a867c007bc3"
[[package]] [[package]]
name = "libdbus-sys" name = "libdbus-sys"
@ -3297,6 +3323,15 @@ dependencies = [
"scopeguard", "scopeguard",
] ]
[[package]]
name = "lock_api"
version = "0.4.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "28247cc5a5be2f05fbcd76dd0cf2c7d3b5400cb978a28042abcd4fa0b3f8261c"
dependencies = [
"scopeguard",
]
[[package]] [[package]]
name = "log" name = "log"
version = "0.4.11" version = "0.4.11"
@ -3724,8 +3759,9 @@ checksum = "0419348c027fa7be448d2ae7ea0e4e04c2334c31dc4e74ab29f00a2a7ca69204"
[[package]] [[package]]
name = "naga" name = "naga"
version = "0.1.0" version = "0.2.0"
source = "git+https://github.com/gfx-rs/naga?rev=1eb637038dd15fc1dad770eca8e6943424dbc122#1eb637038dd15fc1dad770eca8e6943424dbc122" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0873deb76cf44b7454fba7b2ba6a89d3de70c08aceffd2c489379b3d9d08e661"
dependencies = [ dependencies = [
"bitflags", "bitflags",
"fxhash", "fxhash",
@ -4117,7 +4153,7 @@ version = "0.9.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f842b1982eb6c2fe34036a4fbfb06dd185a3f5c8edfaacdf7d1ea10b07de6252" checksum = "f842b1982eb6c2fe34036a4fbfb06dd185a3f5c8edfaacdf7d1ea10b07de6252"
dependencies = [ dependencies = [
"lock_api", "lock_api 0.3.4",
"parking_lot_core 0.6.2", "parking_lot_core 0.6.2",
"rustc_version", "rustc_version",
] ]
@ -4128,10 +4164,21 @@ version = "0.10.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d3a704eb390aafdc107b0e392f56a82b668e3a71366993b5340f5833fd62505e" checksum = "d3a704eb390aafdc107b0e392f56a82b668e3a71366993b5340f5833fd62505e"
dependencies = [ dependencies = [
"lock_api", "lock_api 0.3.4",
"parking_lot_core 0.7.2", "parking_lot_core 0.7.2",
] ]
[[package]]
name = "parking_lot"
version = "0.11.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a4893845fa2ca272e647da5d0e46660a314ead9c2fdd9a883aabc32e481a8733"
dependencies = [
"instant",
"lock_api 0.4.1",
"parking_lot_core 0.8.0",
]
[[package]] [[package]]
name = "parking_lot_core" name = "parking_lot_core"
version = "0.6.2" version = "0.6.2"
@ -4139,7 +4186,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b876b1b9e7ac6e1a74a6da34d25c42e17e8862aa409cbbbdcfc8d86c6f3bc62b" checksum = "b876b1b9e7ac6e1a74a6da34d25c42e17e8862aa409cbbbdcfc8d86c6f3bc62b"
dependencies = [ dependencies = [
"cfg-if", "cfg-if",
"cloudabi", "cloudabi 0.0.3",
"libc", "libc",
"redox_syscall", "redox_syscall",
"rustc_version", "rustc_version",
@ -4154,7 +4201,22 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d58c7c768d4ba344e3e8d72518ac13e259d7c7ade24167003b8488e10b6740a3" checksum = "d58c7c768d4ba344e3e8d72518ac13e259d7c7ade24167003b8488e10b6740a3"
dependencies = [ dependencies = [
"cfg-if", "cfg-if",
"cloudabi", "cloudabi 0.0.3",
"libc",
"redox_syscall",
"smallvec 1.4.2",
"winapi",
]
[[package]]
name = "parking_lot_core"
version = "0.8.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c361aa727dd08437f2f1447be8b59a33b0edd15e0fcee698f935613d9efbca9b"
dependencies = [
"cfg-if",
"cloudabi 0.1.0",
"instant",
"libc", "libc",
"redox_syscall", "redox_syscall",
"smallvec 1.4.2", "smallvec 1.4.2",
@ -4715,6 +4777,17 @@ dependencies = [
"serde", "serde",
] ]
[[package]]
name = "ron"
version = "0.6.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a91260f321dbf3b5a16ff91c451dc9eb644ce72775a6812f9c3dfffe63818f8f"
dependencies = [
"base64 0.12.0",
"bitflags",
"serde",
]
[[package]] [[package]]
name = "rust-argon2" name = "rust-argon2"
version = "0.7.0" version = "0.7.0"
@ -5700,11 +5773,11 @@ dependencies = [
[[package]] [[package]]
name = "storage-map" name = "storage-map"
version = "0.2.0" version = "0.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fd0a4829a5c591dc24a944a736d6b1e4053e51339a79fd5d4702c4c999a9c45e" checksum = "418bb14643aa55a7841d5303f72cf512cfb323b8cc221d51580500a1ca75206c"
dependencies = [ dependencies = [
"lock_api", "lock_api 0.4.1",
] ]
[[package]] [[package]]
@ -6856,7 +6929,7 @@ dependencies = [
"num-traits", "num-traits",
"plane-split", "plane-split",
"rayon", "rayon",
"ron", "ron 0.5.1",
"serde", "serde",
"serde_json", "serde_json",
"sig", "sig",
@ -6954,8 +7027,8 @@ dependencies = [
[[package]] [[package]]
name = "wgpu-core" name = "wgpu-core"
version = "0.5.0" version = "0.6.0"
source = "git+https://github.com/gfx-rs/wgpu#f7ec6cc1fe73651cfeda44295cd41533ec60f850" source = "git+https://github.com/gfx-rs/wgpu#1d0e0ce37ede5ec53000ab252c27b8cf856865b2"
dependencies = [ dependencies = [
"arrayvec 0.5.1", "arrayvec 0.5.1",
"bitflags", "bitflags",
@ -6970,8 +7043,8 @@ dependencies = [
"gfx-hal", "gfx-hal",
"gfx-memory", "gfx-memory",
"naga", "naga",
"parking_lot 0.10.2", "parking_lot 0.11.0",
"ron", "ron 0.6.0",
"serde", "serde",
"smallvec 1.4.2", "smallvec 1.4.2",
"thiserror", "thiserror",
@ -6981,8 +7054,8 @@ dependencies = [
[[package]] [[package]]
name = "wgpu-types" name = "wgpu-types"
version = "0.5.0" version = "0.6.0"
source = "git+https://github.com/gfx-rs/wgpu#f7ec6cc1fe73651cfeda44295cd41533ec60f850" source = "git+https://github.com/gfx-rs/wgpu#1d0e0ce37ede5ec53000ab252c27b8cf856865b2"
dependencies = [ dependencies = [
"bitflags", "bitflags",
"serde", "serde",

View file

@ -292,6 +292,7 @@ impl GPUCommandEncoderMethods for GPUCommandEncoder {
size: GPUSize64, size: GPUSize64,
) { ) {
let scope_id = self.device.use_current_scope(); let scope_id = self.device.use_current_scope();
println!("CopyBufferToBuffer scope_id {:?}", scope_id);
if !(*self.state.borrow() == GPUCommandEncoderState::Open) { if !(*self.state.borrow() == GPUCommandEncoderState::Open) {
self.device.handle_server_msg( self.device.handle_server_msg(

View file

@ -178,6 +178,7 @@ impl GPUDevice {
} }
pub fn handle_server_msg(&self, scope: Option<ErrorScopeId>, result: WebGPUOpResult) { pub fn handle_server_msg(&self, scope: Option<ErrorScopeId>, result: WebGPUOpResult) {
println!("handle_server_msg {:?}, {:?}", scope, result);
let result = match result { let result = match result {
WebGPUOpResult::Success => Ok(()), WebGPUOpResult::Success => Ok(()),
WebGPUOpResult::ValidationError(m) => { WebGPUOpResult::ValidationError(m) => {
@ -221,6 +222,7 @@ impl GPUDevice {
} }
fn handle_error(&self, scope: ErrorScopeId, error: GPUError) { fn handle_error(&self, scope: ErrorScopeId, error: GPUError) {
println!("handle_error {}", scope);
let mut context = self.scope_context.borrow_mut(); let mut context = self.scope_context.borrow_mut();
if let Some(mut err_scope) = context.error_scopes.get_mut(&scope) { if let Some(mut err_scope) = context.error_scopes.get_mut(&scope) {
if err_scope.error.is_none() { if err_scope.error.is_none() {
@ -232,6 +234,7 @@ impl GPUDevice {
} }
fn try_remove_scope(&self, scope: ErrorScopeId) { fn try_remove_scope(&self, scope: ErrorScopeId) {
println!("try_remove_scope {}", scope);
let mut context = self.scope_context.borrow_mut(); let mut context = self.scope_context.borrow_mut();
let remove = if let Some(mut err_scope) = context.error_scopes.get_mut(&scope) { let remove = if let Some(mut err_scope) = context.error_scopes.get_mut(&scope) {
err_scope.op_count -= 1; err_scope.op_count -= 1;
@ -250,6 +253,7 @@ impl GPUDevice {
false false
}; };
if remove { if remove {
println!("remove {}", scope);
let _ = context.error_scopes.remove(&scope); let _ = context.error_scopes.remove(&scope);
context.scope_stack.retain(|meta| meta.id != scope); context.scope_stack.retain(|meta| meta.id != scope);
} }
@ -370,6 +374,7 @@ impl GPUDeviceMethods for GPUDevice {
.create_buffer_id(self.device.0.backend()); .create_buffer_id(self.device.0.backend());
let scope_id = self.use_current_scope(); let scope_id = self.use_current_scope();
println!("CreateBuffer scope {:?}", scope_id);
if desc.is_none() { if desc.is_none() {
self.handle_server_msg( self.handle_server_msg(
scope_id, scope_id,
@ -1088,6 +1093,7 @@ impl GPUDeviceMethods for GPUDevice {
fn PushErrorScope(&self, filter: GPUErrorFilter) { fn PushErrorScope(&self, filter: GPUErrorFilter) {
let mut context = self.scope_context.borrow_mut(); let mut context = self.scope_context.borrow_mut();
let scope_id = context.next_scope_id; let scope_id = context.next_scope_id;
println!("PushErrorScope {}", scope_id);
context.next_scope_id = ErrorScopeId::new(scope_id.get() + 1).unwrap(); context.next_scope_id = ErrorScopeId::new(scope_id.get() + 1).unwrap();
let err_scope = ErrorScopeInfo { let err_scope = ErrorScopeInfo {
op_count: 0, op_count: 0,
@ -1115,6 +1121,7 @@ impl GPUDeviceMethods for GPUDevice {
promise.reject_error(Error::Operation); promise.reject_error(Error::Operation);
return promise; return promise;
}; };
println!("PopErrorScope {}", scope_id);
let remove = if let Some(mut err_scope) = context.error_scopes.get_mut(&scope_id) { let remove = if let Some(mut err_scope) = context.error_scopes.get_mut(&scope_id) {
if let Some(ref e) = err_scope.error { if let Some(ref e) = err_scope.error {
promise.resolve_native(e); promise.resolve_native(e);
@ -1128,6 +1135,7 @@ impl GPUDeviceMethods for GPUDevice {
false false
}; };
if remove { if remove {
println!("PopErrorScope remove {}", scope_id);
let _ = context.error_scopes.remove(&scope_id); let _ = context.error_scopes.remove(&scope_id);
context.scope_stack.retain(|meta| meta.id != scope_id); context.scope_stack.retain(|meta| meta.id != scope_id);
} }

View file

@ -22,5 +22,5 @@ servo_config = { path = "../config" }
smallvec = { version = "0.6", features = ["serde"] } smallvec = { version = "0.6", features = ["serde"] }
webrender_api = { git = "https://github.com/servo/webrender" } webrender_api = { git = "https://github.com/servo/webrender" }
webrender_traits = { path = "../webrender_traits" } webrender_traits = { path = "../webrender_traits" }
wgpu-core = { version = "0.5.0", git = "https://github.com/gfx-rs/wgpu", features = ["replay", "trace", "serial-pass"] } wgpu-core = { version = "0.6.0", git = "https://github.com/gfx-rs/wgpu", features = ["replay", "trace", "serial-pass"] }
wgpu-types = { version = "0.5.0", git = "https://github.com/gfx-rs/wgpu", features = ["replay", "trace"] } wgpu-types = { version = "0.6.0", git = "https://github.com/gfx-rs/wgpu", features = ["replay", "trace"] }

View file

@ -496,6 +496,7 @@ impl<'a> WGPU<'a> {
destination_offset, destination_offset,
size size
)); ));
println!("CopyBufferToBuffer result {:?}", result);
self.send_result(device_id, scope_id, result); self.send_result(device_id, scope_id, result);
}, },
WebGPURequest::CopyBufferToTexture { WebGPURequest::CopyBufferToTexture {
@ -593,6 +594,7 @@ impl<'a> WGPU<'a> {
self.send_result(device_id, scope_id, result); self.send_result(device_id, scope_id, result);
} else { } else {
let _ = gfx_select!(buffer_id => global.buffer_error(buffer_id)); let _ = gfx_select!(buffer_id => global.buffer_error(buffer_id));
println!("CreateBuffer error {:?}", buffer_id);
} }
}, },
WebGPURequest::CreateCommandEncoder { WebGPURequest::CreateCommandEncoder {