32: Improve locking safety for Registry r=grovesNL a=kvark

This isn't ideal: we shouldn't be mutably locking anything for adding/removing objects in `local` path. But at least it makes it safe, for now.

Co-authored-by: Dzmitry Malyshau <dmalyshau@mozilla.com>
This commit is contained in:
bors[bot] 2018-12-02 03:54:19 +00:00
commit 1144834ba8
18 changed files with 442 additions and 341 deletions

View File

@ -16,4 +16,4 @@ script:
- cargo test
- cargo build --manifest-path wgpu-native/Cargo.toml --features remote
- cargo build
#- (cd examples && make) #TODO
- (cd examples && make) #TODO

430
Cargo.lock generated
View File

@ -1,3 +1,16 @@
[[package]]
name = "andrew"
version = "0.1.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"bitflags 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)",
"line_drawing 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
"rusttype 0.7.3 (registry+https://github.com/rust-lang/crates.io-index)",
"walkdir 2.2.7 (registry+https://github.com/rust-lang/crates.io-index)",
"xdg 2.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
"xml-rs 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "android_glue"
version = "0.2.3"
@ -12,11 +25,19 @@ dependencies = [
]
[[package]]
name = "arrayvec"
version = "0.4.7"
name = "approx"
version = "0.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"nodrop 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)",
"num-traits 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "arrayvec"
version = "0.4.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"nodrop 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
@ -25,7 +46,7 @@ version = "0.24.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"lazy_static 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.44 (registry+https://github.com/rust-lang/crates.io-index)",
"shared_library 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)",
]
@ -34,7 +55,7 @@ name = "atty"
version = "0.2.11"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.44 (registry+https://github.com/rust-lang/crates.io-index)",
"termion 1.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
"winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
]
@ -46,7 +67,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"backtrace-sys 0.1.24 (registry+https://github.com/rust-lang/crates.io-index)",
"cfg-if 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.44 (registry+https://github.com/rust-lang/crates.io-index)",
"rustc-demangle 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)",
"winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
]
@ -57,7 +78,7 @@ version = "0.1.24"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"cc 1.0.25 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.44 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
@ -78,7 +99,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "cbindgen"
version = "0.6.7"
source = "git+https://github.com/eqrion/cbindgen.git#3e07fe7ffe5c04c1f80446a655afa9319d796080"
source = "git+https://github.com/grovesNL/cbindgen?branch=associated-constants#fce3e8302de527eb9dec0570b8de0d97bcea900d"
dependencies = [
"clap 2.32.0 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
@ -86,8 +107,8 @@ dependencies = [
"serde_derive 1.0.58 (registry+https://github.com/rust-lang/crates.io-index)",
"serde_json 1.0.33 (registry+https://github.com/rust-lang/crates.io-index)",
"syn 0.14.9 (registry+https://github.com/rust-lang/crates.io-index)",
"tempfile 3.0.4 (registry+https://github.com/rust-lang/crates.io-index)",
"toml 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)",
"tempfile 3.0.5 (registry+https://github.com/rust-lang/crates.io-index)",
"toml 0.4.9 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
@ -122,18 +143,6 @@ dependencies = [
"bitflags 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "cocoa"
version = "0.17.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"bitflags 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)",
"block 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
"core-graphics 0.16.0 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)",
"objc 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "cocoa"
version = "0.18.4"
@ -144,7 +153,7 @@ dependencies = [
"core-foundation 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)",
"core-graphics 0.17.3 (registry+https://github.com/rust-lang/crates.io-index)",
"foreign-types 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.44 (registry+https://github.com/rust-lang/crates.io-index)",
"objc 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)",
]
@ -154,7 +163,7 @@ version = "0.6.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"core-foundation-sys 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.44 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
@ -162,17 +171,6 @@ name = "core-foundation-sys"
version = "0.6.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "core-graphics"
version = "0.16.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"bitflags 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)",
"core-foundation 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)",
"foreign-types 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "core-graphics"
version = "0.17.3"
@ -181,7 +179,7 @@ dependencies = [
"bitflags 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)",
"core-foundation 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)",
"foreign-types 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.44 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
@ -198,9 +196,9 @@ name = "derivative"
version = "1.0.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"proc-macro2 0.4.21 (registry+https://github.com/rust-lang/crates.io-index)",
"proc-macro2 0.4.24 (registry+https://github.com/rust-lang/crates.io-index)",
"quote 0.6.10 (registry+https://github.com/rust-lang/crates.io-index)",
"syn 0.15.20 (registry+https://github.com/rust-lang/crates.io-index)",
"syn 0.15.22 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
@ -238,9 +236,9 @@ name = "failure_derive"
version = "0.1.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"proc-macro2 0.4.21 (registry+https://github.com/rust-lang/crates.io-index)",
"proc-macro2 0.4.24 (registry+https://github.com/rust-lang/crates.io-index)",
"quote 0.6.10 (registry+https://github.com/rust-lang/crates.io-index)",
"syn 0.15.20 (registry+https://github.com/rust-lang/crates.io-index)",
"syn 0.15.22 (registry+https://github.com/rust-lang/crates.io-index)",
"synstructure 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)",
]
@ -287,23 +285,23 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "gfx-backend-dx12"
version = "0.1.0"
source = "git+https://github.com/gfx-rs/gfx#f288599e34e536ee406edd3cab81589ab29dc784"
source = "git+https://github.com/gfx-rs/gfx#389429e14319ee4994ab4ada3338a3b930046e4d"
dependencies = [
"bitflags 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)",
"d3d12 0.1.0 (git+https://github.com/gfx-rs/d3d12-rs.git?rev=ee01154)",
"derivative 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)",
"gfx-hal 0.1.0 (git+https://github.com/gfx-rs/gfx)",
"log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
"smallvec 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)",
"smallvec 0.6.7 (registry+https://github.com/rust-lang/crates.io-index)",
"spirv_cross 0.11.2 (registry+https://github.com/rust-lang/crates.io-index)",
"winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
"winit 0.17.2 (registry+https://github.com/rust-lang/crates.io-index)",
"winit 0.18.0 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "gfx-backend-empty"
version = "0.1.0"
source = "git+https://github.com/gfx-rs/gfx#f288599e34e536ee406edd3cab81589ab29dc784"
source = "git+https://github.com/gfx-rs/gfx#389429e14319ee4994ab4ada3338a3b930046e4d"
dependencies = [
"gfx-hal 0.1.0 (git+https://github.com/gfx-rs/gfx)",
]
@ -311,7 +309,7 @@ dependencies = [
[[package]]
name = "gfx-backend-metal"
version = "0.1.0"
source = "git+https://github.com/gfx-rs/gfx#f288599e34e536ee406edd3cab81589ab29dc784"
source = "git+https://github.com/gfx-rs/gfx#389429e14319ee4994ab4ada3338a3b930046e4d"
dependencies = [
"bitflags 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)",
"block 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
@ -323,25 +321,25 @@ dependencies = [
"metal 0.13.0 (registry+https://github.com/rust-lang/crates.io-index)",
"objc 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)",
"parking_lot 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)",
"smallvec 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)",
"smallvec 0.6.7 (registry+https://github.com/rust-lang/crates.io-index)",
"spirv_cross 0.11.2 (registry+https://github.com/rust-lang/crates.io-index)",
"storage-map 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
"winit 0.17.2 (registry+https://github.com/rust-lang/crates.io-index)",
"winit 0.18.0 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "gfx-backend-vulkan"
version = "0.1.0"
source = "git+https://github.com/gfx-rs/gfx#f288599e34e536ee406edd3cab81589ab29dc784"
source = "git+https://github.com/gfx-rs/gfx#389429e14319ee4994ab4ada3338a3b930046e4d"
dependencies = [
"ash 0.24.4 (registry+https://github.com/rust-lang/crates.io-index)",
"byteorder 1.2.7 (registry+https://github.com/rust-lang/crates.io-index)",
"gfx-hal 0.1.0 (git+https://github.com/gfx-rs/gfx)",
"lazy_static 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
"smallvec 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)",
"smallvec 0.6.7 (registry+https://github.com/rust-lang/crates.io-index)",
"winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
"winit 0.17.2 (registry+https://github.com/rust-lang/crates.io-index)",
"winit 0.18.0 (registry+https://github.com/rust-lang/crates.io-index)",
"x11 2.18.1 (registry+https://github.com/rust-lang/crates.io-index)",
"xcb 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)",
]
@ -349,12 +347,12 @@ dependencies = [
[[package]]
name = "gfx-hal"
version = "0.1.0"
source = "git+https://github.com/gfx-rs/gfx#f288599e34e536ee406edd3cab81589ab29dc784"
source = "git+https://github.com/gfx-rs/gfx#389429e14319ee4994ab4ada3338a3b930046e4d"
dependencies = [
"bitflags 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)",
"failure 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
"fxhash 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
"smallvec 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)",
"smallvec 0.6.7 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
@ -374,7 +372,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "libc"
version = "0.2.43"
version = "0.2.44"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
@ -387,11 +385,19 @@ dependencies = [
]
[[package]]
name = "lock_api"
version = "0.1.4"
name = "line_drawing"
version = "0.7.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"owning_ref 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
"num-traits 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "lock_api"
version = "0.1.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"owning_ref 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
"scopeguard 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
]
@ -408,7 +414,7 @@ name = "malloc_buf"
version = "0.0.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.44 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
@ -416,7 +422,7 @@ name = "memmap"
version = "0.6.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.44 (registry+https://github.com/rust-lang/crates.io-index)",
"winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
]
@ -430,7 +436,7 @@ dependencies = [
"cocoa 0.18.4 (registry+https://github.com/rust-lang/crates.io-index)",
"core-graphics 0.17.3 (registry+https://github.com/rust-lang/crates.io-index)",
"foreign-types 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.44 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
"objc 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)",
"objc-foundation 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
@ -445,13 +451,18 @@ dependencies = [
"bitflags 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)",
"cc 1.0.25 (registry+https://github.com/rust-lang/crates.io-index)",
"cfg-if 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.44 (registry+https://github.com/rust-lang/crates.io-index)",
"void 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "nodrop"
version = "0.1.12"
version = "0.1.13"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "num-traits"
version = "0.2.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
@ -489,9 +500,17 @@ dependencies = [
"objc 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "ordered-float"
version = "1.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"num-traits 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "owning_ref"
version = "0.3.3"
version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"stable_deref_trait 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
@ -502,7 +521,7 @@ name = "parking_lot"
version = "0.6.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"lock_api 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
"lock_api 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
"parking_lot_core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
]
@ -511,10 +530,10 @@ name = "parking_lot_core"
version = "0.3.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.44 (registry+https://github.com/rust-lang/crates.io-index)",
"rand 0.5.5 (registry+https://github.com/rust-lang/crates.io-index)",
"rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
"smallvec 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)",
"smallvec 0.6.7 (registry+https://github.com/rust-lang/crates.io-index)",
"winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
]
@ -538,7 +557,7 @@ dependencies = [
[[package]]
name = "proc-macro2"
version = "0.4.21"
version = "0.4.24"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
@ -557,7 +576,7 @@ name = "quote"
version = "0.6.10"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"proc-macro2 0.4.21 (registry+https://github.com/rust-lang/crates.io-index)",
"proc-macro2 0.4.24 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
@ -567,11 +586,38 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"cloudabi 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)",
"fuchsia-zircon 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.44 (registry+https://github.com/rust-lang/crates.io-index)",
"rand_core 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
"winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "rand"
version = "0.6.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"cloudabi 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)",
"fuchsia-zircon 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.44 (registry+https://github.com/rust-lang/crates.io-index)",
"rand_chacha 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
"rand_core 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
"rand_hc 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
"rand_isaac 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
"rand_pcg 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
"rand_xorshift 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
"rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
"winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "rand_chacha"
version = "0.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"rand_core 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
"rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "rand_core"
version = "0.2.2"
@ -585,9 +631,42 @@ name = "rand_core"
version = "0.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "rand_hc"
version = "0.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"rand_core 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "rand_isaac"
version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"rand_core 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "rand_pcg"
version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"rand_core 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
"rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "rand_xorshift"
version = "0.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"rand_core 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "redox_syscall"
version = "0.1.40"
version = "0.1.43"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
@ -595,7 +674,7 @@ name = "redox_termios"
version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"redox_syscall 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)",
"redox_syscall 0.1.43 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
@ -619,11 +698,30 @@ dependencies = [
"semver 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "rusttype"
version = "0.7.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"approx 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
"arrayvec 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)",
"ordered-float 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
"stb_truetype 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "ryu"
version = "0.2.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "same-file"
version = "1.0.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"winapi-util 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "scopeguard"
version = "0.3.3"
@ -676,12 +774,12 @@ version = "0.1.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"lazy_static 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.44 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "smallvec"
version = "0.6.5"
version = "0.6.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"unreachable 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
@ -689,18 +787,19 @@ dependencies = [
[[package]]
name = "smithay-client-toolkit"
version = "0.3.0"
version = "0.4.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"andrew 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
"bitflags 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)",
"dlib 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
"lazy_static 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
"memmap 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)",
"nix 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)",
"rand 0.5.5 (registry+https://github.com/rust-lang/crates.io-index)",
"wayland-client 0.20.12 (registry+https://github.com/rust-lang/crates.io-index)",
"wayland-commons 0.20.12 (registry+https://github.com/rust-lang/crates.io-index)",
"wayland-protocols 0.20.12 (registry+https://github.com/rust-lang/crates.io-index)",
"wayland-client 0.21.7 (registry+https://github.com/rust-lang/crates.io-index)",
"wayland-commons 0.21.7 (registry+https://github.com/rust-lang/crates.io-index)",
"wayland-protocols 0.21.7 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
@ -716,12 +815,20 @@ name = "stable_deref_trait"
version = "1.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "stb_truetype"
version = "0.2.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"byteorder 1.2.7 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "storage-map"
version = "0.1.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"lock_api 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
"lock_api 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
@ -744,17 +851,17 @@ name = "syn"
version = "0.14.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"proc-macro2 0.4.21 (registry+https://github.com/rust-lang/crates.io-index)",
"proc-macro2 0.4.24 (registry+https://github.com/rust-lang/crates.io-index)",
"quote 0.6.10 (registry+https://github.com/rust-lang/crates.io-index)",
"unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "syn"
version = "0.15.20"
version = "0.15.22"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"proc-macro2 0.4.21 (registry+https://github.com/rust-lang/crates.io-index)",
"proc-macro2 0.4.24 (registry+https://github.com/rust-lang/crates.io-index)",
"quote 0.6.10 (registry+https://github.com/rust-lang/crates.io-index)",
"unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
]
@ -764,21 +871,21 @@ name = "synstructure"
version = "0.10.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"proc-macro2 0.4.21 (registry+https://github.com/rust-lang/crates.io-index)",
"proc-macro2 0.4.24 (registry+https://github.com/rust-lang/crates.io-index)",
"quote 0.6.10 (registry+https://github.com/rust-lang/crates.io-index)",
"syn 0.15.20 (registry+https://github.com/rust-lang/crates.io-index)",
"syn 0.15.22 (registry+https://github.com/rust-lang/crates.io-index)",
"unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "tempfile"
version = "3.0.4"
version = "3.0.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"cfg-if 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)",
"rand 0.5.5 (registry+https://github.com/rust-lang/crates.io-index)",
"redox_syscall 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.44 (registry+https://github.com/rust-lang/crates.io-index)",
"rand 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)",
"redox_syscall 0.1.43 (registry+https://github.com/rust-lang/crates.io-index)",
"remove_dir_all 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
"winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
]
@ -788,8 +895,8 @@ name = "termion"
version = "1.5.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)",
"redox_syscall 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.44 (registry+https://github.com/rust-lang/crates.io-index)",
"redox_syscall 0.1.43 (registry+https://github.com/rust-lang/crates.io-index)",
"redox_termios 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
]
@ -803,7 +910,7 @@ dependencies = [
[[package]]
name = "toml"
version = "0.4.8"
version = "0.4.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"serde 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)",
@ -837,50 +944,62 @@ name = "void"
version = "1.0.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "walkdir"
version = "2.2.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"same-file 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)",
"winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
"winapi-util 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "wayland-client"
version = "0.20.12"
version = "0.21.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"bitflags 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)",
"wayland-commons 0.20.12 (registry+https://github.com/rust-lang/crates.io-index)",
"wayland-scanner 0.20.12 (registry+https://github.com/rust-lang/crates.io-index)",
"wayland-sys 0.20.12 (registry+https://github.com/rust-lang/crates.io-index)",
"downcast-rs 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.44 (registry+https://github.com/rust-lang/crates.io-index)",
"nix 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)",
"wayland-commons 0.21.7 (registry+https://github.com/rust-lang/crates.io-index)",
"wayland-scanner 0.21.7 (registry+https://github.com/rust-lang/crates.io-index)",
"wayland-sys 0.21.7 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "wayland-commons"
version = "0.20.12"
version = "0.21.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"downcast-rs 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)",
"wayland-sys 0.20.12 (registry+https://github.com/rust-lang/crates.io-index)",
"nix 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)",
"wayland-sys 0.21.7 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "wayland-protocols"
version = "0.20.12"
version = "0.21.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"bitflags 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)",
"wayland-client 0.20.12 (registry+https://github.com/rust-lang/crates.io-index)",
"wayland-commons 0.20.12 (registry+https://github.com/rust-lang/crates.io-index)",
"wayland-scanner 0.20.12 (registry+https://github.com/rust-lang/crates.io-index)",
"wayland-sys 0.20.12 (registry+https://github.com/rust-lang/crates.io-index)",
"wayland-client 0.21.7 (registry+https://github.com/rust-lang/crates.io-index)",
"wayland-commons 0.21.7 (registry+https://github.com/rust-lang/crates.io-index)",
"wayland-scanner 0.21.7 (registry+https://github.com/rust-lang/crates.io-index)",
"wayland-sys 0.21.7 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "wayland-scanner"
version = "0.20.12"
version = "0.21.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"xml-rs 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
"xml-rs 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "wayland-sys"
version = "0.20.12"
version = "0.21.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"dlib 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
@ -891,7 +1010,7 @@ dependencies = [
name = "wgpu"
version = "0.1.0"
dependencies = [
"arrayvec 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)",
"arrayvec 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)",
"wgpu-native 0.1.0",
]
@ -899,7 +1018,7 @@ dependencies = [
name = "wgpu-bindings"
version = "0.1.0"
dependencies = [
"cbindgen 0.6.7 (git+https://github.com/eqrion/cbindgen.git)",
"cbindgen 0.6.7 (git+https://github.com/grovesNL/cbindgen?branch=associated-constants)",
]
[[package]]
@ -931,6 +1050,14 @@ name = "winapi-i686-pc-windows-gnu"
version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "winapi-util"
version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "winapi-x86_64-pc-windows-gnu"
version = "0.4.0"
@ -938,21 +1065,21 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "winit"
version = "0.17.2"
version = "0.18.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"android_glue 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
"cocoa 0.17.0 (registry+https://github.com/rust-lang/crates.io-index)",
"cocoa 0.18.4 (registry+https://github.com/rust-lang/crates.io-index)",
"core-foundation 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)",
"core-graphics 0.16.0 (registry+https://github.com/rust-lang/crates.io-index)",
"core-graphics 0.17.3 (registry+https://github.com/rust-lang/crates.io-index)",
"lazy_static 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.44 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
"objc 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)",
"parking_lot 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)",
"percent-encoding 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
"smithay-client-toolkit 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
"wayland-client 0.20.12 (registry+https://github.com/rust-lang/crates.io-index)",
"smithay-client-toolkit 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)",
"wayland-client 0.21.7 (registry+https://github.com/rust-lang/crates.io-index)",
"winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
"x11-dl 2.18.3 (registry+https://github.com/rust-lang/crates.io-index)",
]
@ -962,7 +1089,7 @@ name = "x11"
version = "2.18.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.44 (registry+https://github.com/rust-lang/crates.io-index)",
"pkg-config 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)",
]
@ -972,7 +1099,7 @@ version = "2.18.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"lazy_static 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.44 (registry+https://github.com/rust-lang/crates.io-index)",
"pkg-config 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)",
]
@ -981,22 +1108,26 @@ name = "xcb"
version = "0.8.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.44 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "xml-rs"
version = "0.7.0"
name = "xdg"
version = "2.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "xml-rs"
version = "0.8.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"bitflags 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)",
]
[metadata]
"checksum andrew 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "62ea7024f6f4d203bede7c0c9cdafa3cbda3a9e0fa04d349008496cc95b8f11b"
"checksum android_glue 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "000444226fcff248f2bc4c7625be32c63caccfecc2723a2b9f78a7487a49c407"
"checksum ansi_term 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ee49baf6cb617b853aa8d93bf420db2383fab46d314482ca2803b40d5fde979b"
"checksum arrayvec 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)" = "a1e964f9e24d588183fcb43503abda40d288c8657dfc27311516ce2f05675aef"
"checksum approx 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "f71f10b5c4946a64aad7b8cf65e3406cd3da22fc448595991d22423cf6db67b4"
"checksum arrayvec 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)" = "f405cc4c21cd8b784f6c8fc2adf9bc00f59558f0049b5ec21517f875963040cc"
"checksum ash 0.24.4 (registry+https://github.com/rust-lang/crates.io-index)" = "11f080bc0414ee1b6b959442cb36478d56c6e6b9bb2b04079a5048d9acc91a30"
"checksum atty 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)" = "9a7d5b8723950951411ee34d271d99dddcc2035a16ab25310ea2c8cfd4369652"
"checksum backtrace 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)" = "89a47830402e9981c5c41223151efcced65a0510c13097c769cede7efb34782a"
@ -1004,16 +1135,14 @@ dependencies = [
"checksum bitflags 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "228047a76f468627ca71776ecdebd732a3423081fcf5125585bcd7c49886ce12"
"checksum block 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "0d8c1fef690941d3e7788d328517591fecc684c084084702d6ff1641e993699a"
"checksum byteorder 1.2.7 (registry+https://github.com/rust-lang/crates.io-index)" = "94f88df23a25417badc922ab0f5716cc1330e87f71ddd9203b3a3ccd9cedf75d"
"checksum cbindgen 0.6.7 (git+https://github.com/eqrion/cbindgen.git)" = "<none>"
"checksum cbindgen 0.6.7 (git+https://github.com/grovesNL/cbindgen?branch=associated-constants)" = "<none>"
"checksum cc 1.0.25 (registry+https://github.com/rust-lang/crates.io-index)" = "f159dfd43363c4d08055a07703eb7a3406b0dac4d0584d96965a3262db3c9d16"
"checksum cfg-if 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "082bb9b28e00d3c9d39cc03e64ce4cea0f1bb9b3fde493f0cbc008472d22bdf4"
"checksum clap 2.32.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b957d88f4b6a63b9d70d5f454ac8011819c6efa7727858f458ab71c756ce2d3e"
"checksum cloudabi 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "ddfc5b9aa5d4507acaf872de71051dfd0e309860e88966e1051e462a077aac4f"
"checksum cocoa 0.17.0 (registry+https://github.com/rust-lang/crates.io-index)" = "f5cd1afb83b2de9c41e5dfedb2bcccb779d433b958404876009ae4b01746ff23"
"checksum cocoa 0.18.4 (registry+https://github.com/rust-lang/crates.io-index)" = "cf79daa4e11e5def06e55306aa3601b87de6b5149671529318da048f67cdd77b"
"checksum core-foundation 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)" = "4e2640d6d0bf22e82bed1b73c6aef8d5dd31e5abe6666c57e6d45e2649f4f887"
"checksum core-foundation-sys 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)" = "e7ca8a5221364ef15ce201e8ed2f609fc312682a8f4e0e3d4aa5879764e0fa3b"
"checksum core-graphics 0.16.0 (registry+https://github.com/rust-lang/crates.io-index)" = "92801c908ea6301ae619ed842a72e01098085fc321b9c2f3f833dad555bba055"
"checksum core-graphics 0.17.3 (registry+https://github.com/rust-lang/crates.io-index)" = "56790968ab1c8a1202a102e6de05fc6e1ec87da99e4e93e9a7d13efbfc1e95a9"
"checksum d3d12 0.1.0 (git+https://github.com/gfx-rs/d3d12-rs.git?rev=ee01154)" = "<none>"
"checksum derivative 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "6073e9676dbebdddeabaeb63e3b7cefd23c86f5c41d381ee1237cc77b1079898"
@ -1035,37 +1164,48 @@ dependencies = [
"checksum itoa 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)" = "1306f3464951f30e30d12373d31c79fbd52d236e5e896fd92f96ec7babbbe60b"
"checksum lazy_static 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)" = "76f033c7ad61445c5b347c7382dd1237847eb1bce590fe50365dcb33d546be73"
"checksum lazy_static 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "a374c89b9db55895453a74c1e38861d9deec0b01b405a82516e9d5de4820dea1"
"checksum libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)" = "76e3a3ef172f1a0b9a9ff0dd1491ae5e6c948b94479a3021819ba7d860c8645d"
"checksum libc 0.2.44 (registry+https://github.com/rust-lang/crates.io-index)" = "10923947f84a519a45c8fefb7dd1b3e8c08747993381adee176d7a82b4195311"
"checksum libloading 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "9c3ad660d7cb8c5822cd83d10897b0f1f1526792737a179e73896152f85b88c2"
"checksum lock_api 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "775751a3e69bde4df9b38dd00a1b5d6ac13791e4223d4a0506577f0dd27cfb7a"
"checksum line_drawing 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "5cc7ad3d82c845bdb5dde34ffdcc7a5fb4d2996e1e1ee0f19c33bc80e15196b9"
"checksum lock_api 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "62ebf1391f6acad60e5c8b43706dde4582df75c06698ab44511d15016bc2442c"
"checksum log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)" = "c84ec4b527950aa83a329754b01dbe3f58361d1c5efacd1f6d68c494d08a17c6"
"checksum malloc_buf 0.0.6 (registry+https://github.com/rust-lang/crates.io-index)" = "62bb907fe88d54d8d9ce32a3cceab4218ed2f6b7d35617cafe9adf84e43919cb"
"checksum memmap 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)" = "e2ffa2c986de11a9df78620c01eeaaf27d94d3ff02bf81bfcca953102dd0c6ff"
"checksum metal 0.13.0 (registry+https://github.com/rust-lang/crates.io-index)" = "8411e1b14691a658f4b285f980c98d1af1922dcf037ea4454288dc456ca0d1ed"
"checksum nix 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d37e713a259ff641624b6cb20e3b12b2952313ba36b6823c0f16e6cfd9e5de17"
"checksum nodrop 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)" = "9a2228dca57108069a5262f2ed8bd2e82496d2e074a06d1ccc7ce1687b6ae0a2"
"checksum nodrop 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)" = "2f9667ddcc6cc8a43afc9b7917599d7216aa09c463919ea32c59ed6cac8bc945"
"checksum num-traits 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)" = "0b3a5d7cc97d6d30d8b9bc8fa19bf45349ffe46241e8816f50f62f6d6aaabee1"
"checksum objc 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)" = "9833ab0efe5361b1e2122a0544a5d3359576911a42cb098c2e59be8650807367"
"checksum objc-foundation 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "1add1b659e36c9607c7aab864a76c7a4c2760cd0cd2e120f3fb8b952c7e22bf9"
"checksum objc_exception 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "098cd29a2fa3c230d3463ae069cecccc3fdfd64c0d2496ab5b96f82dab6a00dc"
"checksum objc_id 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "c92d4ddb4bd7b50d730c215ff871754d0da6b2178849f8a2a2ab69712d0c073b"
"checksum owning_ref 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "cdf84f41639e037b484f93433aa3897863b561ed65c6e59c7073d7c561710f37"
"checksum ordered-float 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "2f0015e9e8e28ee20c581cfbfe47c650cedeb9ed0721090e0b7ebb10b9cdbcc2"
"checksum owning_ref 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "49a4b8ea2179e6a2e27411d3bca09ca6dd630821cf6894c6c7c8467a8ee7ef13"
"checksum parking_lot 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)" = "f0802bff09003b291ba756dc7e79313e51cc31667e94afbe847def490424cde5"
"checksum parking_lot_core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "ad7f7e6ebdc79edff6fdcb87a55b620174f7a989e3eb31b65231f4af57f00b8c"
"checksum percent-encoding 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "31010dd2e1ac33d5b46a5b413495239882813e0369f8ed8a5e266f173602f831"
"checksum pkg-config 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)" = "676e8eb2b1b4c9043511a9b7bea0915320d7e502b0a079fb03f9635a5252b18c"
"checksum proc-macro2 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)" = "1b06e2f335f48d24442b35a19df506a835fb3547bc3c06ef27340da9acf5cae7"
"checksum proc-macro2 0.4.21 (registry+https://github.com/rust-lang/crates.io-index)" = "ab2fc21ba78ac73e4ff6b3818ece00be4e175ffbef4d0a717d978b48b24150c4"
"checksum proc-macro2 0.4.24 (registry+https://github.com/rust-lang/crates.io-index)" = "77619697826f31a02ae974457af0b29b723e5619e113e9397b8b82c6bd253f09"
"checksum quote 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "9949cfe66888ffe1d53e6ec9d9f3b70714083854be20fd5e271b232a017401e8"
"checksum quote 0.6.10 (registry+https://github.com/rust-lang/crates.io-index)" = "53fa22a1994bd0f9372d7a816207d8a2677ad0325b073f5c5332760f0fb62b5c"
"checksum rand 0.5.5 (registry+https://github.com/rust-lang/crates.io-index)" = "e464cd887e869cddcae8792a4ee31d23c7edd516700695608f5b98c67ee0131c"
"checksum rand 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)" = "ae9d223d52ae411a33cf7e54ec6034ec165df296ccd23533d671a28252b6f66a"
"checksum rand_chacha 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "771b009e3a508cb67e8823dda454aaa5368c7bc1c16829fb77d3e980440dd34a"
"checksum rand_core 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "1961a422c4d189dfb50ffa9320bf1f2a9bd54ecb92792fb9477f99a1045f3372"
"checksum rand_core 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "0905b6b7079ec73b314d4c748701f6931eb79fd97c668caa3f1899b22b32c6db"
"checksum redox_syscall 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)" = "c214e91d3ecf43e9a4e41e578973adeb14b474f2bee858742d127af75a0112b1"
"checksum rand_hc 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7b40677c7be09ae76218dc623efbf7b18e34bced3f38883af07bb75630a21bc4"
"checksum rand_isaac 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "ded997c9d5f13925be2a6fd7e66bf1872597f759fd9dd93513dd7e92e5a5ee08"
"checksum rand_pcg 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "086bd09a33c7044e56bb44d5bdde5a60e7f119a9e95b0775f545de759a32fe05"
"checksum rand_xorshift 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "effa3fcaa47e18db002bdde6060944b6d2f9cfd8db471c30e873448ad9187be3"
"checksum redox_syscall 0.1.43 (registry+https://github.com/rust-lang/crates.io-index)" = "679da7508e9a6390aeaf7fbd02a800fdc64b73fe2204dd2c8ae66d22d9d5ad5d"
"checksum redox_termios 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "7e891cfe48e9100a70a3b6eb652fef28920c117d366339687bd5576160db0f76"
"checksum remove_dir_all 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "3488ba1b9a2084d38645c4c08276a1752dcbf2c7130d74f1569681ad5d2799c5"
"checksum rustc-demangle 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)" = "bcfe5b13211b4d78e5c2cadfebd7769197d95c639c35a50057eb4c05de811395"
"checksum rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "138e3e0acb6c9fb258b19b67cb8abd63c00679d2851805ea151465464fe9030a"
"checksum rusttype 0.7.3 (registry+https://github.com/rust-lang/crates.io-index)" = "436c67ae0d0d24f14e1177c3ed96780ee16db82b405f0fba1bb80b46c9a30625"
"checksum ryu 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)" = "eb9e9b8cde282a9fe6a42dd4681319bfb63f121b8a8ee9439c6f4107e58a46f7"
"checksum same-file 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "8f20c4be53a8a1ff4c1f1b2bd14570d2f634628709752f0702ecdd2b3f9a5267"
"checksum scopeguard 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "94258f53601af11e6a49f722422f6e3425c52b06245a5cf9bc09908b174f5e27"
"checksum semver 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403"
"checksum semver-parser 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3"
@ -1073,35 +1213,39 @@ dependencies = [
"checksum serde_derive 1.0.58 (registry+https://github.com/rust-lang/crates.io-index)" = "ac38f51a52a556cd17545798e29536885fb1a3fa63d6399f5ef650f4a7d35901"
"checksum serde_json 1.0.33 (registry+https://github.com/rust-lang/crates.io-index)" = "c37ccd6be3ed1fdf419ee848f7c758eb31b054d7cd3ae3600e3bae0adf569811"
"checksum shared_library 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)" = "5a9e7e0f2bfae24d8a5b5a66c5b257a83c7412304311512a0c054cd5e619da11"
"checksum smallvec 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)" = "153ffa32fd170e9944f7e0838edf824a754ec4c1fc64746fcc9fe1f8fa602e5d"
"checksum smithay-client-toolkit 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "f1609083d6bca3991a3c648d80ae16e1764d70881c3321bee1c915149073d605"
"checksum smallvec 0.6.7 (registry+https://github.com/rust-lang/crates.io-index)" = "b73ea3738b47563803ef814925e69be00799a8c07420be8b996f8e98fb2336db"
"checksum smithay-client-toolkit 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "ef227bd9251cf8f8e54f8dd9a4b164307e515f5312cd632ebc87b56f723893a2"
"checksum spirv_cross 0.11.2 (registry+https://github.com/rust-lang/crates.io-index)" = "2cc3aef2f7822a4fdd4174f547700f208bbc0f0871c59b754573717c92fd29f4"
"checksum stable_deref_trait 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "dba1a27d3efae4351c8051072d619e3ade2820635c3958d826bfea39d59b54c8"
"checksum stb_truetype 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)" = "48fa7d3136d8645909de1f7c7eb5416cc43057a75ace08fc39ae736bc9da8af1"
"checksum storage-map 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "cb94f167ccba0941876c8e722e888be8b4c05511ffdacc8cfcd4c647adfd424d"
"checksum strsim 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "bb4f380125926a99e52bc279241539c018323fab05ad6368b56f93d9369ff550"
"checksum syn 0.13.11 (registry+https://github.com/rust-lang/crates.io-index)" = "14f9bf6292f3a61d2c716723fdb789a41bbe104168e6f496dc6497e531ea1b9b"
"checksum syn 0.14.9 (registry+https://github.com/rust-lang/crates.io-index)" = "261ae9ecaa397c42b960649561949d69311f08eeaea86a65696e6e46517cf741"
"checksum syn 0.15.20 (registry+https://github.com/rust-lang/crates.io-index)" = "8886c8d2774e853fcd7d9d2131f6e40ba46c9c0e358e4d57178452abd6859bb0"
"checksum syn 0.15.22 (registry+https://github.com/rust-lang/crates.io-index)" = "ae8b29eb5210bc5cf63ed6149cbf9adfc82ac0be023d8735c176ee74a2db4da7"
"checksum synstructure 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)" = "73687139bf99285483c96ac0add482c3776528beac1d97d444f6e91f203a2015"
"checksum tempfile 3.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "55c1195ef8513f3273d55ff59fe5da6940287a0d7a98331254397f464833675b"
"checksum tempfile 3.0.5 (registry+https://github.com/rust-lang/crates.io-index)" = "7e91405c14320e5c79b3d148e1c86f40749a36e490642202a31689cb1a3452b2"
"checksum termion 1.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "689a3bdfaab439fd92bc87df5c4c78417d3cbe537487274e9b0b2dce76e92096"
"checksum textwrap 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)" = "307686869c93e71f94da64286f9a9524c0f308a9e1c87a583de8e9c9039ad3f6"
"checksum toml 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)" = "4a2ecc31b0351ea18b3fe11274b8db6e4d82bce861bbb22e6dbed40417902c65"
"checksum toml 0.4.9 (registry+https://github.com/rust-lang/crates.io-index)" = "19782e145d5abefb03758958f06ea35f7b1d8421b534140e0238fd3d0bfd66e3"
"checksum unicode-width 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "882386231c45df4700b275c7ff55b6f3698780a650026380e72dabe76fa46526"
"checksum unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "fc72304796d0818e357ead4e000d19c9c174ab23dc11093ac919054d20a6a7fc"
"checksum unreachable 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "382810877fe448991dfc7f0dd6e3ae5d58088fd0ea5e35189655f84e6814fa56"
"checksum vec_map 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)" = "05c78687fb1a80548ae3250346c3db86a80a7cdd77bda190189f2d0a0987c81a"
"checksum void 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d"
"checksum wayland-client 0.20.12 (registry+https://github.com/rust-lang/crates.io-index)" = "e7516a23419a55bd2e6d466c75a6a52c85718e5013660603289c2b8bee794b12"
"checksum wayland-commons 0.20.12 (registry+https://github.com/rust-lang/crates.io-index)" = "d8609d59b95bf198bae4f3b064d55a712f2d529eec6aac98cc1f6e9cc911d47a"
"checksum wayland-protocols 0.20.12 (registry+https://github.com/rust-lang/crates.io-index)" = "bd4d31a96be6ecdbaddbf35200f5af2daee01be592afecd8feaf443d417e9230"
"checksum wayland-scanner 0.20.12 (registry+https://github.com/rust-lang/crates.io-index)" = "e674d85ae9c67cbbc590374d8f2e20a7a02fff87ce3a31fc52213afece8d05ad"
"checksum wayland-sys 0.20.12 (registry+https://github.com/rust-lang/crates.io-index)" = "87c82ee658aa657fdfd7061f22e442030d921cfefc5bad68bcf41973e67922f7"
"checksum walkdir 2.2.7 (registry+https://github.com/rust-lang/crates.io-index)" = "9d9d7ed3431229a144296213105a390676cc49c9b6a72bd19f3176c98e129fa1"
"checksum wayland-client 0.21.7 (registry+https://github.com/rust-lang/crates.io-index)" = "267d642a6e551e5af62a5e4fbfaab299221e6ddbd453b5985cfa84c835887679"
"checksum wayland-commons 0.21.7 (registry+https://github.com/rust-lang/crates.io-index)" = "da95f98e6b8222cb0f248811ecd69ba6ebe243b737fd34020f7c73665bb4a3af"
"checksum wayland-protocols 0.21.7 (registry+https://github.com/rust-lang/crates.io-index)" = "a1d20e951995113cdb8f32578c8402e619aa3d3e894f3ca334deb219abc1f6df"
"checksum wayland-scanner 0.21.7 (registry+https://github.com/rust-lang/crates.io-index)" = "4f17846a40a19f7917f11c18a6c8c3b3a34b3ba09cb200d3e03503ebdfcbf3a7"
"checksum wayland-sys 0.21.7 (registry+https://github.com/rust-lang/crates.io-index)" = "a0931c24c91e4e56c1119e4137e237df2ccc3696df94f64b1e2f61982d89cc32"
"checksum winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)" = "92c1eb33641e276cfa214a0522acad57be5c56b10cb348b3c5117db75f3ac4b0"
"checksum winapi-i686-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6"
"checksum winapi-util 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "afc5508759c5bf4285e61feb862b6083c8480aec864fa17a81fdec6f69b461ab"
"checksum winapi-x86_64-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f"
"checksum winit 0.17.2 (registry+https://github.com/rust-lang/crates.io-index)" = "ba44cf306b981badc781894ab5d6fda54764a0512cbbf8db4685d329014143fa"
"checksum winit 0.18.0 (registry+https://github.com/rust-lang/crates.io-index)" = "27aa86a5723951d6a08c2acb9f10e25cb39ceb5b1987d7daf74e181b21f8f50b"
"checksum x11 2.18.1 (registry+https://github.com/rust-lang/crates.io-index)" = "39697e3123f715483d311b5826e254b6f3cfebdd83cf7ef3358f579c3d68e235"
"checksum x11-dl 2.18.3 (registry+https://github.com/rust-lang/crates.io-index)" = "940586acb859ea05c53971ac231685799a7ec1dee66ac0bccc0e6ad96e06b4e3"
"checksum xcb 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)" = "5e917a3f24142e9ff8be2414e36c649d47d6cc2ba81f16201cdef96e533e02de"
"checksum xml-rs 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3c1cb601d29fe2c2ac60a2b2e5e293994d87a1f6fa9687a31a15270f909be9c2"
"checksum xdg 2.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d089681aa106a86fade1b0128fb5daf07d5867a509ab036d99988dec80429a57"
"checksum xml-rs 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "541b12c998c5b56aa2b4e6f18f03664eef9a4fd0a246a55594efae6cc2d964b5"

View File

@ -56,8 +56,8 @@ lib-rust: Cargo.lock wgpu-rs/Cargo.toml $(wildcard wgpu-rs/**/*.rs)
wgpu-bindings/wgpu.h: Cargo.lock wgpu-bindings/src/*.rs lib-native
cargo +nightly run --manifest-path wgpu-bindings/Cargo.toml
#examples-native: lib-native wgpu-bindings/wgpu.h $(wildcard wgpu-native/**/*.c)
# $(MAKE) -C examples
examples-native: lib-native wgpu-bindings/wgpu.h $(wildcard wgpu-native/**/*.c)
$(MAKE) -C examples
examples-rust: lib-rust examples/Cargo.toml $(wildcard wgpu-native/**/*.rs)
cargo build --manifest-path examples/Cargo.toml --bin hello_triangle --features $(FEATURE_RUST)

View File

@ -1,8 +1,8 @@
CC=gcc
CFLAGS=-I.
DEPS=./../wgpu-bindings/wgpu.h
DEPS=./wgpu-bindings/wgpu.h
OUTDIR=./build
LINK_ARGS=-L ./../target/debug -lwgpu_native
LINK_ARGS=-L ../target/debug -lwgpu_native
%.o: %.c $(DEPS)
$(CC) $(LINK_ARGS) -c -o $(OUTDIR)/$@ $< $(CFLAGS)

View File

@ -10,4 +10,5 @@ authors = [
default = []
[dependencies]
cbindgen = { git = "https://github.com/eqrion/cbindgen.git" }
#cbindgen = "0.6.7"
cbindgen = { git = "https://github.com/grovesNL/cbindgen", branch = "associated-constants"}

View File

@ -123,6 +123,10 @@ typedef WGPUId WGPUCommandBufferId;
typedef WGPUId WGPURenderPassId;
typedef WGPUId WGPUBindGroupId;
typedef WGPUId WGPUComputePipelineId;
typedef WGPUId WGPUInstanceId;
typedef WGPUId WGPUBindGroupLayoutId;
@ -265,35 +269,17 @@ typedef struct {
uint32_t array_count;
} WGPUTextureViewDescriptor;
#define WGPUBufferUsageFlags_INDEX (WGPUBufferUsageFlags){ .bits = 16 }
#define WGPUColorWriteFlags_ALL 15
#define WGPUBufferUsageFlags_MAP_READ (WGPUBufferUsageFlags){ .bits = 1 }
#define WGPUColorWriteFlags_ALPHA 8
#define WGPUBufferUsageFlags_MAP_WRITE (WGPUBufferUsageFlags){ .bits = 2 }
#define WGPUColorWriteFlags_BLUE 4
#define WGPUBufferUsageFlags_NONE (WGPUBufferUsageFlags){ .bits = 0 }
#define WGPUColorWriteFlags_COLOR 7
#define WGPUBufferUsageFlags_STORAGE (WGPUBufferUsageFlags){ .bits = 128 }
#define WGPUColorWriteFlags_GREEN 2
#define WGPUBufferUsageFlags_TRANSFER_DST (WGPUBufferUsageFlags){ .bits = 8 }
#define WGPUBufferUsageFlags_TRANSFER_SRC (WGPUBufferUsageFlags){ .bits = 4 }
#define WGPUBufferUsageFlags_UNIFORM (WGPUBufferUsageFlags){ .bits = 64 }
#define WGPUBufferUsageFlags_VERTEX (WGPUBufferUsageFlags){ .bits = 32 }
#define WGPUColorWriteFlags_ALL (WGPUColorWriteFlags){ .bits = 15 }
#define WGPUColorWriteFlags_ALPHA (WGPUColorWriteFlags){ .bits = 8 }
#define WGPUColorWriteFlags_BLUE (WGPUColorWriteFlags){ .bits = 4 }
#define WGPUColorWriteFlags_COLOR (WGPUColorWriteFlags){ .bits = 7 }
#define WGPUColorWriteFlags_GREEN (WGPUColorWriteFlags){ .bits = 2 }
#define WGPUColorWriteFlags_RED (WGPUColorWriteFlags){ .bits = 1 }
#define WGPUColorWriteFlags_RED 1
#define WGPUColor_BLACK (WGPUColor){ .r = 0, .g = 0, .b = 0, .a = 1 }
@ -307,35 +293,31 @@ typedef struct {
#define WGPUColor_WHITE (WGPUColor){ .r = 1, .g = 1, .b = 1, .a = 1 }
#define WGPUShaderStageFlags_COMPUTE (WGPUShaderStageFlags){ .bits = 4 }
#define WGPUShaderStageFlags_COMPUTE 4
#define WGPUShaderStageFlags_FRAGMENT (WGPUShaderStageFlags){ .bits = 2 }
#define WGPUShaderStageFlags_FRAGMENT 2
#define WGPUShaderStageFlags_VERTEX (WGPUShaderStageFlags){ .bits = 1 }
#define WGPUShaderStageFlags_VERTEX 1
#define WGPUTextureAspectFlags_COLOR (WGPUTextureAspectFlags){ .bits = 1 }
#define WGPUTextureAspectFlags_COLOR 1
#define WGPUTextureAspectFlags_DEPTH (WGPUTextureAspectFlags){ .bits = 2 }
#define WGPUTextureAspectFlags_DEPTH 2
#define WGPUTextureAspectFlags_STENCIL (WGPUTextureAspectFlags){ .bits = 4 }
#define WGPUTextureAspectFlags_STENCIL 4
#define WGPUTextureUsageFlags_NONE (WGPUTextureUsageFlags){ .bits = 0 }
#define WGPUTextureUsageFlags_NONE 0
#define WGPUTextureUsageFlags_OUTPUT_ATTACHMENT (WGPUTextureUsageFlags){ .bits = 16 }
#define WGPUTextureUsageFlags_OUTPUT_ATTACHMENT 16
#define WGPUTextureUsageFlags_PRESENT (WGPUTextureUsageFlags){ .bits = 32 }
#define WGPUTextureUsageFlags_PRESENT 32
#define WGPUTextureUsageFlags_SAMPLED (WGPUTextureUsageFlags){ .bits = 4 }
#define WGPUTextureUsageFlags_SAMPLED 4
#define WGPUTextureUsageFlags_STORAGE (WGPUTextureUsageFlags){ .bits = 8 }
#define WGPUTextureUsageFlags_STORAGE 8
#define WGPUTextureUsageFlags_TRANSFER_DST (WGPUTextureUsageFlags){ .bits = 2 }
#define WGPUTextureUsageFlags_TRANSFER_DST 2
#define WGPUTextureUsageFlags_TRANSFER_SRC (WGPUTextureUsageFlags){ .bits = 1 }
#define WGPUTrackPermit_EXTEND (WGPUTrackPermit){ .bits = 1 }
#define WGPUTrackPermit_REPLACE (WGPUTrackPermit){ .bits = 2 }
#define WGPUTextureUsageFlags_TRANSFER_SRC 1
WGPUDeviceId wgpu_adapter_create_device(WGPUAdapterId adapter_id,
const WGPUDeviceDescriptor *_desc);
@ -345,8 +327,16 @@ WGPUComputePassId wgpu_command_buffer_begin_compute_pass(WGPUCommandBufferId com
WGPURenderPassId wgpu_command_buffer_begin_render_pass(WGPUCommandBufferId command_buffer_id,
WGPURenderPassDescriptor_TextureViewId desc);
void wgpu_compute_pass_dispatch(WGPUComputePassId pass_id, uint32_t x, uint32_t y, uint32_t z);
WGPUCommandBufferId wgpu_compute_pass_end_pass(WGPUComputePassId pass_id);
void wgpu_compute_pass_set_bind_group(WGPUComputePassId pass_id,
uint32_t index,
WGPUBindGroupId bind_group_id);
void wgpu_compute_pass_set_pipeline(WGPUComputePassId pass_id, WGPUComputePipelineId pipeline_id);
WGPUInstanceId wgpu_create_instance(void);
WGPUBindGroupLayoutId wgpu_device_create_bind_group_layout(WGPUDeviceId device_id,
@ -388,6 +378,6 @@ WGPUTextureViewId wgpu_texture_create_default_texture_view(WGPUTextureId texture
WGPUTextureViewId wgpu_texture_create_texture_view(WGPUTextureId texture_id,
const WGPUTextureViewDescriptor *desc);
void wgpu_texture_destroy(WGPUDeviceId texture_id);
void wgpu_texture_destroy(WGPUTextureId texture_id);
void wgpu_texture_view_destroy(WGPUTextureViewId _texture_view_id);

View File

@ -11,13 +11,13 @@ crate-type = ["lib", "cdylib", "staticlib"]
[features]
default = []
remote = ["parking_lot"]
remote = []
[dependencies]
bitflags = "1.0"
lazy_static = "1.1.0"
log = "0.4"
parking_lot = { version = "0.6", optional = true }
parking_lot = { version = "0.6" }
gfx-hal = { git = "https://github.com/gfx-rs/gfx" } # required by gfx-memory
gfx-backend-empty = { git = "https://github.com/gfx-rs/gfx" }
gfx-backend-vulkan = { git = "https://github.com/gfx-rs/gfx", optional = true }

View File

@ -1,4 +1,4 @@
use registry::{HUB, Items, Registry};
use registry::{HUB, Items};
use {
Stored,
BindGroupId, CommandBufferId, ComputePassId, ComputePipelineId,
@ -29,11 +29,11 @@ pub extern "C" fn wgpu_compute_pass_end_pass(
pass_id: ComputePassId,
) -> CommandBufferId {
let pass = HUB.compute_passes
.lock()
.write()
.take(pass_id);
HUB.command_buffers
.lock()
.write()
.get_mut(pass.cmb_id.value)
.raw
.push(pass.raw);
@ -44,13 +44,13 @@ pub extern "C" fn wgpu_compute_pass_end_pass(
pub extern "C" fn wgpu_compute_pass_set_bind_group(
pass_id: ComputePassId, index: u32, bind_group_id: BindGroupId,
) {
let bind_group_guard = HUB.bind_groups.lock();
let bind_group_guard = HUB.bind_groups.read();
let set = &bind_group_guard.get(bind_group_id).raw;
let layout = unimplemented!();
// see https://github.com/gpuweb/gpuweb/pull/93
HUB.compute_passes
.lock()
.write()
.get_mut(pass_id)
.raw
.bind_compute_descriptor_sets(layout, index as usize, iter::once(set), &[]);
@ -60,11 +60,11 @@ pub extern "C" fn wgpu_compute_pass_set_bind_group(
pub extern "C" fn wgpu_compute_pass_set_pipeline(
pass_id: ComputePassId, pipeline_id: ComputePipelineId,
) {
let pipeline_guard = HUB.compute_pipelines.lock();
let pipeline_guard = HUB.compute_pipelines.read();
let pipeline = &pipeline_guard.get(pipeline_id).raw;
HUB.compute_passes
.lock()
.write()
.get_mut(pass_id)
.raw
.bind_compute_pipeline(pipeline);
@ -75,7 +75,7 @@ pub extern "C" fn wgpu_compute_pass_dispatch(
pass_id: ComputePassId, x: u32, y: u32, z: u32,
) {
HUB.compute_passes
.lock()
.write()
.get_mut(pass_id)
.raw
.dispatch([x, y, z]);

View File

@ -13,9 +13,9 @@ use {
B, Color, LifeGuard, Origin3d, Stored, BufferUsageFlags, TextureUsageFlags, WeaklyStored,
BufferId, CommandBufferId, ComputePassId, DeviceId, RenderPassId, TextureId, TextureViewId,
};
use conv;
use {conv, resource};
use device::{FramebufferKey, RenderPassKey};
use registry::{HUB, Items, Registry};
use registry::{HUB, Items};
use track::{BufferTracker, TextureTracker};
use std::collections::hash_map::Entry;
@ -89,17 +89,18 @@ pub struct CommandBuffer<B: hal::Backend> {
}
impl CommandBuffer<B> {
pub(crate) fn insert_barriers<I, J>(
pub(crate) fn insert_barriers<I, J, Gb, Gt>(
raw: &mut <B as hal::Backend>::CommandBuffer,
buffer_iter: I,
texture_iter: J,
buffer_guard: &Gb,
texture_guard: &Gt,
) where
I: Iterator<Item = (BufferId, Range<BufferUsageFlags>)>,
J: Iterator<Item = (TextureId, Range<TextureUsageFlags>)>,
Gb: Items<resource::Buffer<B>>,
Gt: Items<resource::Texture<B>>,
{
let buffer_guard = HUB.buffers.lock();
let texture_guard = HUB.textures.lock();
let buffer_barriers = buffer_iter.map(|(id, transit)| {
let b = buffer_guard.get(id);
trace!("transit {:?} {:?}", id, transit);
@ -137,11 +138,11 @@ pub extern "C" fn wgpu_command_buffer_begin_render_pass(
command_buffer_id: CommandBufferId,
desc: RenderPassDescriptor<TextureViewId>,
) -> RenderPassId {
let mut cmb_guard = HUB.command_buffers.lock();
let mut cmb_guard = HUB.command_buffers.write();
let cmb = cmb_guard.get_mut(command_buffer_id);
let device_guard = HUB.devices.lock();
let device_guard = HUB.devices.read();
let device = device_guard.get(cmb.device_id.value);
let view_guard = HUB.texture_views.lock();
let view_guard = HUB.texture_views.read();
let mut current_comb = device.com_allocator.extend(cmb);
current_comb.begin(
@ -202,7 +203,7 @@ pub extern "C" fn wgpu_command_buffer_begin_render_pass(
}
};
let mut render_pass_cache = device.render_passes.lock().unwrap();
let mut render_pass_cache = device.render_passes.lock();
let render_pass = match render_pass_cache.entry(rp_key) {
Entry::Occupied(e) => e.into_mut(),
Entry::Vacant(e) => {
@ -231,7 +232,7 @@ pub extern "C" fn wgpu_command_buffer_begin_render_pass(
}
};
let mut framebuffer_cache = device.framebuffers.lock().unwrap();
let mut framebuffer_cache = device.framebuffers.lock();
let fb_key = FramebufferKey {
attachments: desc.color_attachments
.iter()
@ -287,7 +288,7 @@ pub extern "C" fn wgpu_command_buffer_begin_render_pass(
);
HUB.render_passes
.lock()
.write()
.register(RenderPass::new(
current_comb,
Stored {
@ -301,7 +302,7 @@ pub extern "C" fn wgpu_command_buffer_begin_render_pass(
pub extern "C" fn wgpu_command_buffer_begin_compute_pass(
command_buffer_id: CommandBufferId,
) -> ComputePassId {
let mut cmb_guard = HUB.command_buffers.lock();
let mut cmb_guard = HUB.command_buffers.write();
let cmb = cmb_guard.get_mut(command_buffer_id);
let raw = cmb.raw.pop().unwrap();
@ -311,6 +312,6 @@ pub extern "C" fn wgpu_command_buffer_begin_compute_pass(
};
HUB.compute_passes
.lock()
.write()
.register(ComputePass::new(raw, stored))
}

View File

@ -1,4 +1,4 @@
use registry::{HUB, Items, Registry};
use registry::{HUB, Items};
use track::{BufferTracker, TextureTracker};
use {
CommandBuffer, Stored,
@ -35,11 +35,11 @@ pub extern "C" fn wgpu_render_pass_end_pass(
pass_id: RenderPassId,
) -> CommandBufferId {
let mut pass = HUB.render_passes
.lock()
.write()
.take(pass_id);
pass.raw.end_render_pass();
let mut cmb_guard = HUB.command_buffers.lock();
let mut cmb_guard = HUB.command_buffers.write();
let cmb = cmb_guard.get_mut(pass.cmb_id.value);
if let Some(ref mut last) = cmb.raw.last_mut() {
@ -47,6 +47,8 @@ pub extern "C" fn wgpu_render_pass_end_pass(
last,
cmb.buffer_tracker.consume(&pass.buffer_tracker),
cmb.texture_tracker.consume(&pass.texture_tracker),
&*HUB.buffers.read(),
&*HUB.textures.read(),
);
last.finish();
}

View File

@ -1,5 +1,5 @@
use {back, binding_model, command, conv, pipeline, resource};
use registry::{HUB, Items, ItemsGuard, Registry};
use registry::{HUB, Items};
use track::{BufferTracker, TextureTracker};
use {
CommandBuffer, LifeGuard, RefCount, Stored, SubmissionIndex, WeaklyStored,
@ -16,7 +16,8 @@ use hal::{self, Device as _Device};
use std::{ffi, slice};
use std::collections::hash_map::{Entry, HashMap};
use std::sync::Mutex;
use parking_lot::Mutex;
use std::sync::atomic::Ordering;
@ -68,11 +69,12 @@ impl<B: hal::Backend> DestroyedResources<B> {
self.referenced.push((resource_id, life_guard.ref_count.clone()));
}
fn triage_referenced(
&mut self,
buffer_guard: &mut ItemsGuard<resource::Buffer<B>>,
texture_guard: &mut ItemsGuard<resource::Texture<B>>,
) {
fn triage_referenced<Gb, Gt>(
&mut self, buffer_guard: &mut Gb, texture_guard: &mut Gt,
) where
Gb: Items<resource::Buffer<B>>,
Gt: Items<resource::Texture<B>>,
{
for i in (0 .. self.referenced.len()).rev() {
// one in resource itself, and one here in this list
let num_refs = self.referenced[i].1.load();
@ -201,7 +203,7 @@ pub extern "C" fn wgpu_device_create_texture(
let format = conv::map_texture_format(desc.format);
let aspects = format.surface_desc().aspects;
let usage = conv::map_texture_usage(desc.usage, aspects);
let device_guard = HUB.devices.lock();
let device_guard = HUB.devices.read();
let device = &device_guard.get(device_id);
let image_unbound = device
.raw
@ -242,7 +244,7 @@ pub extern "C" fn wgpu_device_create_texture(
let life_guard = LifeGuard::new();
let ref_count = life_guard.ref_count.clone();
let id = HUB.textures
.lock()
.write()
.register(resource::Texture {
raw: bound_image,
device_id: Stored {
@ -256,7 +258,6 @@ pub extern "C" fn wgpu_device_create_texture(
});
let query = device.texture_tracker
.lock()
.unwrap()
.query(
&Stored { value: id, ref_count },
TextureUsageFlags::WRITE_ALL,
@ -271,11 +272,11 @@ pub extern "C" fn wgpu_texture_create_texture_view(
texture_id: TextureId,
desc: &resource::TextureViewDescriptor,
) -> TextureViewId {
let texture_guard = HUB.textures.lock();
let texture_guard = HUB.textures.read();
let texture = texture_guard.get(texture_id);
let raw = HUB.devices
.lock()
.read()
.get(texture.device_id.value)
.raw
.create_image_view(
@ -292,7 +293,7 @@ pub extern "C" fn wgpu_texture_create_texture_view(
.unwrap();
HUB.texture_views
.lock()
.write()
.register(resource::TextureView {
raw,
texture_id: Stored {
@ -310,7 +311,7 @@ pub extern "C" fn wgpu_texture_create_texture_view(
pub extern "C" fn wgpu_texture_create_default_texture_view(
texture_id: TextureId,
) -> TextureViewId {
let texture_guard = HUB.textures.lock();
let texture_guard = HUB.textures.read();
let texture = texture_guard.get(texture_id);
let view_kind = match texture.kind {
@ -320,7 +321,7 @@ pub extern "C" fn wgpu_texture_create_default_texture_view(
};
let raw = HUB.devices
.lock()
.read()
.get(texture.device_id.value)
.raw
.create_image_view(
@ -333,7 +334,7 @@ pub extern "C" fn wgpu_texture_create_default_texture_view(
.unwrap();
HUB.texture_views
.lock()
.write()
.register(resource::TextureView {
raw,
texture_id: Stored {
@ -351,14 +352,13 @@ pub extern "C" fn wgpu_texture_create_default_texture_view(
pub extern "C" fn wgpu_texture_destroy(
texture_id: TextureId,
) {
let texture_guard = HUB.textures.lock();
let texture_guard = HUB.textures.read();
let texture = texture_guard.get(texture_id);
let device_guard = HUB.devices.lock();
let device_guard = HUB.devices.write();
device_guard
.get(texture.device_id.value)
.destroyed
.lock()
.unwrap()
.add(ResourceId::Texture(texture_id), &texture.life_guard);
}
@ -377,7 +377,7 @@ pub extern "C" fn wgpu_device_create_bind_group_layout(
let bindings = unsafe { slice::from_raw_parts(desc.bindings, desc.bindings_length) };
let descriptor_set_layout = HUB.devices
.lock()
.read()
.get(device_id)
.raw
.create_descriptor_set_layout(
@ -395,7 +395,7 @@ pub extern "C" fn wgpu_device_create_bind_group_layout(
.unwrap();
HUB.bind_group_layouts
.lock()
.write()
.register(binding_model::BindGroupLayout {
raw: descriptor_set_layout,
})
@ -409,21 +409,21 @@ pub extern "C" fn wgpu_device_create_pipeline_layout(
let bind_group_layouts = unsafe {
slice::from_raw_parts(desc.bind_group_layouts, desc.bind_group_layouts_length)
};
let bind_group_layout_guard = HUB.bind_group_layouts.lock();
let bind_group_layout_guard = HUB.bind_group_layouts.read();
let descriptor_set_layouts = bind_group_layouts
.iter()
.map(|&id| &bind_group_layout_guard.get(id).raw);
// TODO: push constants
let pipeline_layout = HUB.devices
.lock()
.read()
.get(device_id)
.raw
.create_pipeline_layout(descriptor_set_layouts, &[])
.unwrap();
HUB.pipeline_layouts
.lock()
.write()
.register(binding_model::PipelineLayout {
raw: pipeline_layout,
})
@ -435,7 +435,7 @@ pub extern "C" fn wgpu_device_create_blend_state(
desc: &pipeline::BlendStateDescriptor,
) -> BlendStateId {
HUB.blend_states
.lock()
.write()
.register(pipeline::BlendState {
raw: conv::map_blend_state_descriptor(desc),
})
@ -447,7 +447,7 @@ pub extern "C" fn wgpu_device_create_depth_stencil_state(
desc: &pipeline::DepthStencilStateDescriptor,
) -> DepthStencilStateId {
HUB.depth_stencil_states
.lock()
.write()
.register(pipeline::DepthStencilState {
raw: conv::map_depth_stencil_state(desc),
})
@ -462,14 +462,14 @@ pub extern "C" fn wgpu_device_create_shader_module(
slice::from_raw_parts(desc.code.bytes, desc.code.length)
};
let shader = HUB.devices
.lock()
.read()
.get(device_id)
.raw
.create_shader_module(spv)
.unwrap();
HUB.shader_modules
.lock()
.write()
.register(ShaderModule { raw: shader })
}
@ -478,7 +478,7 @@ pub extern "C" fn wgpu_device_create_command_buffer(
device_id: DeviceId,
_desc: &command::CommandBufferDescriptor,
) -> CommandBufferId {
let device_guard = HUB.devices.lock();
let device_guard = HUB.devices.read();
let device = device_guard.get(device_id);
let dev_stored = Stored {
@ -490,7 +490,7 @@ pub extern "C" fn wgpu_device_create_command_buffer(
hal::command::CommandBufferFlags::ONE_TIME_SUBMIT,
hal::command::CommandBufferInheritanceInfo::default(),
);
HUB.command_buffers.lock().register(cmd_buf)
HUB.command_buffers.write().register(cmd_buf)
}
#[no_mangle]
@ -504,18 +504,18 @@ pub extern "C" fn wgpu_queue_submit(
command_buffer_ptr: *const CommandBufferId,
command_buffer_count: usize,
) {
let mut device_guard = HUB.devices.lock();
let mut device_guard = HUB.devices.write();
let device = device_guard.get_mut(queue_id);
let mut buffer_tracker = device.buffer_tracker.lock().unwrap();
let mut texture_tracker = device.texture_tracker.lock().unwrap();
let mut buffer_tracker = device.buffer_tracker.lock();
let mut texture_tracker = device.texture_tracker.lock();
let mut command_buffer_guard = HUB.command_buffers.lock();
let mut command_buffer_guard = HUB.command_buffers.write();
let command_buffer_ids = unsafe {
slice::from_raw_parts(command_buffer_ptr, command_buffer_count)
};
let mut buffer_guard = HUB.buffers.lock();
let mut texture_guard = HUB.textures.lock();
let mut buffer_guard = HUB.buffers.write();
let mut texture_guard = HUB.textures.write();
let old_submit_index = device.life_guard.submission_index.fetch_add(1, Ordering::Relaxed);
//TODO: if multiple command buffers are submitted, we can re-use the last
@ -544,6 +544,8 @@ pub extern "C" fn wgpu_queue_submit(
&mut transit,
buffer_tracker.consume(&comb.buffer_tracker),
texture_tracker.consume(&comb.texture_tracker),
&*buffer_guard,
&*texture_guard,
);
transit.finish();
comb.raw.insert(0, transit);
@ -572,8 +574,9 @@ pub extern "C" fn wgpu_queue_submit(
}
}
if let Ok(mut destroyed) = device.destroyed.lock() {
destroyed.triage_referenced(&mut buffer_guard, &mut texture_guard);
{
let mut destroyed = device.destroyed.lock();
destroyed.triage_referenced(&mut *buffer_guard, &mut *texture_guard);
destroyed.cleanup(&device.raw);
destroyed.active.push(ActiveFrame {
@ -601,12 +604,12 @@ pub extern "C" fn wgpu_device_create_render_pipeline(
height: 100,
};
let device_guard = HUB.devices.lock();
let device_guard = HUB.devices.read();
let device = device_guard.get(device_id);
let pipeline_layout_guard = HUB.pipeline_layouts.lock();
let pipeline_layout_guard = HUB.pipeline_layouts.read();
let layout = &pipeline_layout_guard.get(desc.layout).raw;
let pipeline_stages = unsafe { slice::from_raw_parts(desc.stages, desc.stages_length) };
let shader_module_guard = HUB.shader_modules.lock();
let shader_module_guard = HUB.shader_modules.read();
let rp_key = {
let op_keep = hal::pass::AttachmentOps {
@ -641,7 +644,7 @@ pub extern "C" fn wgpu_device_create_render_pipeline(
}
};
let mut render_pass_cache = device.render_passes.lock().unwrap();
let mut render_pass_cache = device.render_passes.lock();
let main_pass = match render_pass_cache.entry(rp_key) {
Entry::Occupied(e) => e.into_mut(),
Entry::Vacant(e) => {
@ -731,7 +734,7 @@ pub extern "C" fn wgpu_device_create_render_pipeline(
primitive_restart: hal::pso::PrimitiveRestart::Disabled, // TODO
};
let blend_state_guard = HUB.blend_states.lock();
let blend_state_guard = HUB.blend_states.read();
let blend_states = unsafe { slice::from_raw_parts(desc.blend_states, desc.blend_states_length) }
.iter()
.map(|id| blend_state_guard.get(id.clone()).raw)
@ -742,7 +745,7 @@ pub extern "C" fn wgpu_device_create_render_pipeline(
targets: blend_states,
};
let depth_stencil_state_guard = HUB.depth_stencil_states.lock();
let depth_stencil_state_guard = HUB.depth_stencil_states.read();
let depth_stencil = depth_stencil_state_guard.get(desc.depth_stencil_state).raw;
// TODO
@ -801,6 +804,6 @@ pub extern "C" fn wgpu_device_create_render_pipeline(
.unwrap();
HUB.render_pipelines
.lock()
.write()
.register(pipeline::RenderPipeline { raw: pipeline })
}

View File

@ -1,6 +1,6 @@
use hal::{self, Instance as _Instance, PhysicalDevice as _PhysicalDevice};
use registry::{HUB, Items, Registry};
use registry::{HUB, Items};
use {AdapterId, Device, DeviceId, InstanceId};
#[repr(C)]
@ -35,7 +35,7 @@ pub extern "C" fn wgpu_create_instance() -> InstanceId {
))]
{
let inst = ::back::Instance::create("wgpu", 1);
HUB.instances.lock().register(inst)
HUB.instances.write().register(inst)
}
#[cfg(not(any(
feature = "gfx-backend-vulkan",
@ -52,7 +52,7 @@ pub extern "C" fn wgpu_instance_get_adapter(
instance_id: InstanceId,
desc: &AdapterDescriptor,
) -> AdapterId {
let instance_guard = HUB.instances.lock();
let instance_guard = HUB.instances.read();
let instance = instance_guard.get(instance_id);
let (mut low, mut high, mut other) = (None, None, None);
for adapter in instance.enumerate_adapters() {
@ -68,7 +68,7 @@ pub extern "C" fn wgpu_instance_get_adapter(
PowerPreference::HighPerformance | PowerPreference::Default => high.or(low),
};
HUB.adapters
.lock()
.write()
.register(some.or(other).unwrap())
}
@ -77,11 +77,11 @@ pub extern "C" fn wgpu_adapter_create_device(
adapter_id: AdapterId,
_desc: &DeviceDescriptor,
) -> DeviceId {
let mut adapter_guard = HUB.adapters.lock();
let mut adapter_guard = HUB.adapters.write();
let adapter = adapter_guard.get_mut(adapter_id);
let (device, queue_group) = adapter.open_with::<_, hal::General>(1, |_qf| true).unwrap();
let mem_props = adapter.physical_device.memory_properties();
HUB.devices
.lock()
.write()
.register(Device::new(device, queue_group, mem_props))
}

View File

@ -4,7 +4,6 @@ extern crate bitflags;
extern crate lazy_static;
#[macro_use]
extern crate log;
#[cfg(feature = "remote")]
extern crate parking_lot;
#[cfg(feature = "gfx-backend-dx12")]
@ -41,17 +40,12 @@ pub use self::pipeline::*;
pub use self::resource::*;
use back::Backend as B;
use registry::Id;
pub use registry::Id;
use std::ptr;
use std::sync::atomic::{AtomicUsize, Ordering};
//#[cfg(not(feature = "remote"))]
//unsafe impl<T> Sync for Stored<T> {}
//#[cfg(not(feature = "remote"))]
//unsafe impl<T> Send for Stored<T> {}
type SubmissionIndex = usize;
#[derive(Debug)]

View File

@ -3,22 +3,29 @@ use std::os::raw::c_void;
pub type Id = *mut c_void;
pub type ItemsGuard<'a, T> = Items<T>;
pub struct Items<T> {
marker: PhantomData<T>,
}
impl<T> Default for Items<T> {
fn default() -> Self {
Items {
marker: PhantomData,
}
}
}
impl<T> super::Items<T> for Items<T> {
fn register(&mut self, handle: T) -> Id {
Box::into_raw(Box::new(handle)) as *mut _ as *mut c_void
}
fn get(&self, id: Id) -> super::Item<T> {
fn get(&self, id: Id) -> &T {
unsafe { (id as *mut T).as_ref() }.unwrap()
}
fn get_mut(&mut self, id: Id) -> super::ItemMut<T> {
fn get_mut(&mut self, id: Id) -> &mut T {
unsafe { (id as *mut T).as_mut() }.unwrap()
}
@ -26,23 +33,3 @@ impl<T> super::Items<T> for Items<T> {
unsafe { *Box::from_raw(id as *mut T) }
}
}
pub struct Registry<T> {
marker: PhantomData<T>,
}
impl<T> Default for Registry<T> {
fn default() -> Self {
Registry {
marker: PhantomData,
}
}
}
impl<T> super::Registry<T> for Registry<T> {
fn lock(&self) -> ItemsGuard<T> {
Items {
marker: PhantomData,
}
}
}

View File

@ -1,12 +1,6 @@
#[cfg(not(feature = "remote"))]
mod local;
#[cfg(feature = "remote")]
mod remote;
use std::sync::Arc;
#[cfg(not(feature = "remote"))]
pub use self::local::{Id, ItemsGuard, Registry as ConcreteRegistry};
#[cfg(feature = "remote")]
pub use self::remote::{Id, ItemsGuard, Registry as ConcreteRegistry};
use parking_lot::RwLock;
use {
AdapterHandle, BindGroupLayoutHandle, BindGroupHandle,
@ -17,20 +11,26 @@ use {
};
type Item<'a, T> = &'a T;
type ItemMut<'a, T> = &'a mut T;
#[cfg(not(feature = "remote"))]
mod local;
#[cfg(feature = "remote")]
mod remote;
pub trait Registry<T>: Default {
fn lock(&self) -> ItemsGuard<T>;
}
#[cfg(not(feature = "remote"))]
pub use self::local::{Id, Items as ConcreteItems};
#[cfg(feature = "remote")]
pub use self::remote::{Id, Items as ConcreteItems};
pub trait Items<T> {
pub trait Items<T>: Default {
fn register(&mut self, handle: T) -> Id;
fn get(&self, id: Id) -> Item<T>;
fn get_mut(&mut self, id: Id) -> ItemMut<T>;
fn get(&self, id: Id) -> &T;
fn get_mut(&mut self, id: Id) -> &mut T;
fn take(&mut self, id: Id) -> T;
}
pub type ConcreteRegistry<T> = Arc<RwLock<ConcreteItems<T>>>;
#[derive(Default)]
pub struct Hub {
pub(crate) instances: ConcreteRegistry<InstanceHandle>,

View File

@ -1,10 +1,7 @@
use hal::backend::FastHashMap;
use parking_lot::{Mutex, MutexGuard};
use std::sync::Arc;
pub type Id = u32;
pub type ItemsGuard<'a, T> = MutexGuard<'a, Items<T>>;
pub struct Items<T> {
next_id: Id,
@ -12,8 +9,8 @@ pub struct Items<T> {
free: Vec<Id>,
}
impl<T> Items<T> {
fn new() -> Self {
impl<T> Default for Items<T> {
fn default() -> Self {
Items {
next_id: 0,
tracked: FastHashMap::default(),
@ -35,11 +32,11 @@ impl<T> super::Items<T> for Items<T> {
id
}
fn get(&self, id: Id) -> super::Item<T> {
fn get(&self, id: Id) -> &T {
self.tracked.get(&id).unwrap()
}
fn get_mut(&mut self, id: Id) -> super::ItemMut<T> {
fn get_mut(&mut self, id: Id) -> &mut T {
self.tracked.get_mut(&id).unwrap()
}
@ -48,21 +45,3 @@ impl<T> super::Items<T> for Items<T> {
self.tracked.remove(&id).unwrap()
}
}
pub struct Registry<T> {
items: Arc<Mutex<Items<T>>>,
}
impl<T> Default for Registry<T> {
fn default() -> Self {
Registry {
items: Arc::new(Mutex::new(Items::new())),
}
}
}
impl<T> super::Registry<T> for Registry<T> {
fn lock(&self) -> ItemsGuard<T> {
self.items.lock()
}
}

View File

@ -7,7 +7,6 @@ use hal;
bitflags! {
#[repr(transparent)]
pub struct BufferUsageFlags: u32 {
const MAP_READ = 1;
const MAP_WRITE = 2;

View File

@ -8,6 +8,7 @@ use std::ops::{BitOr, Range};
#[derive(Clone, Debug, PartialEq)]
#[allow(unused)]
pub enum Tracktion<T> {
Init,
Keep,