diff --git a/Cargo.lock b/Cargo.lock index 17dd30ef4fa..69531872ea4 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -7,10 +7,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "ash" -version = "0.29.0" +version = "0.30.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "shared_library 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", + "libloading 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -79,23 +79,18 @@ dependencies = [ [[package]] name = "cocoa" -version = "0.19.1" +version = "0.20.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "block 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", - "core-foundation 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)", - "core-graphics 0.17.3 (registry+https://github.com/rust-lang/crates.io-index)", + "core-foundation 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", + "core-graphics 0.19.0 (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.66 (registry+https://github.com/rust-lang/crates.io-index)", "objc 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "colorful" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" - [[package]] name = "copyless" version = "0.1.4" @@ -110,18 +105,32 @@ dependencies = [ "libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "core-foundation" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "core-foundation-sys 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "core-foundation-sys" version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "core-foundation-sys" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "core-graphics" -version = "0.17.3" +version = "0.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", - "core-foundation 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)", + "core-foundation 0.7.0 (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.66 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -159,112 +168,131 @@ dependencies = [ [[package]] name = "gfx-auxil" -version = "0.1.0" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "fxhash 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", - "gfx-hal 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", - "spirv_cross 0.16.0 (registry+https://github.com/rust-lang/crates.io-index)", + "gfx-hal 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", + "spirv_cross 0.18.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "gfx-backend-dx11" -version = "0.4.3" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", - "gfx-auxil 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "gfx-hal 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", + "gfx-auxil 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "gfx-hal 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", "libloading 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", - "parking_lot 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", + "parking_lot 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)", "range-alloc 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "raw-window-handle 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", - "smallvec 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)", - "spirv_cross 0.16.0 (registry+https://github.com/rust-lang/crates.io-index)", + "smallvec 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "spirv_cross 0.18.0 (registry+https://github.com/rust-lang/crates.io-index)", "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", "wio 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "gfx-backend-dx12" -version = "0.4.1" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "d3d12 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", - "gfx-auxil 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "gfx-hal 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", + "gfx-auxil 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "gfx-hal 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "range-alloc 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "raw-window-handle 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", - "smallvec 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)", - "spirv_cross 0.16.0 (registry+https://github.com/rust-lang/crates.io-index)", + "smallvec 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "spirv_cross 0.18.0 (registry+https://github.com/rust-lang/crates.io-index)", "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "gfx-backend-empty" -version = "0.4.0" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "gfx-hal 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", + "gfx-hal 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", "raw-window-handle 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "gfx-backend-metal" -version = "0.4.1" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "arrayvec 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", "bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "block 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", - "cocoa 0.19.1 (registry+https://github.com/rust-lang/crates.io-index)", + "cocoa 0.20.0 (registry+https://github.com/rust-lang/crates.io-index)", "copyless 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", - "core-graphics 0.17.3 (registry+https://github.com/rust-lang/crates.io-index)", + "core-graphics 0.19.0 (registry+https://github.com/rust-lang/crates.io-index)", "foreign-types 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", - "gfx-auxil 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "gfx-hal 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", + "gfx-auxil 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "gfx-hal 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", - "metal 0.17.1 (registry+https://github.com/rust-lang/crates.io-index)", + "metal 0.18.0 (registry+https://github.com/rust-lang/crates.io-index)", "objc 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)", - "parking_lot 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", + "parking_lot 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)", "range-alloc 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "raw-window-handle 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", - "smallvec 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)", - "spirv_cross 0.16.0 (registry+https://github.com/rust-lang/crates.io-index)", + "smallvec 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "spirv_cross 0.18.0 (registry+https://github.com/rust-lang/crates.io-index)", "storage-map 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "gfx-backend-vulkan" -version = "0.4.0" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "arrayvec 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", - "ash 0.29.0 (registry+https://github.com/rust-lang/crates.io-index)", + "ash 0.30.0 (registry+https://github.com/rust-lang/crates.io-index)", "byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)", - "core-graphics 0.17.3 (registry+https://github.com/rust-lang/crates.io-index)", - "gfx-hal 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", + "core-graphics 0.19.0 (registry+https://github.com/rust-lang/crates.io-index)", + "gfx-hal 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "objc 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)", "raw-window-handle 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", - "smallvec 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)", + "smallvec 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", "x11 2.18.1 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "gfx-descriptor" +version = "0.1.0" +dependencies = [ + "fxhash 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "gfx-hal 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "gfx-hal" -version = "0.4.1" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "raw-window-handle 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", - "smallvec 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "gfx-memory" +version = "0.1.0" +dependencies = [ + "fxhash 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "gfx-hal 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", + "hibitset 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", + "slab 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -346,13 +374,13 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "metal" -version = "0.17.1" +version = "0.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "block 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", - "cocoa 0.19.1 (registry+https://github.com/rust-lang/crates.io-index)", - "core-graphics 0.17.3 (registry+https://github.com/rust-lang/crates.io-index)", + "cocoa 0.20.0 (registry+https://github.com/rust-lang/crates.io-index)", + "core-graphics 0.19.0 (registry+https://github.com/rust-lang/crates.io-index)", "foreign-types 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "objc 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)", @@ -405,6 +433,15 @@ dependencies = [ "rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "parking_lot" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "lock_api 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", + "parking_lot_core 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "parking_lot_core" version = "0.6.2" @@ -419,6 +456,19 @@ dependencies = [ "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "parking_lot_core" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", + "cloudabi 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)", + "redox_syscall 0.1.56 (registry+https://github.com/rust-lang/crates.io-index)", + "smallvec 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "peek-poke" version = "0.2.0" @@ -476,40 +526,6 @@ name = "redox_syscall" version = "0.1.56" source = "registry+https://github.com/rust-lang/crates.io-index" -[[package]] -name = "relevant" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "rendy-descriptor" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "gfx-hal 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", - "relevant 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", - "smallvec 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "rendy-memory" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "colorful 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", - "gfx-hal 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", - "hibitset 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", - "relevant 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", - "slab 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", - "smallvec 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "rustc_version" version = "0.2.3" @@ -554,15 +570,6 @@ dependencies = [ "syn 1.0.11 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "shared_library" -version = "0.1.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "slab" version = "0.4.2" @@ -583,7 +590,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "spirv_cross" -version = "0.16.0" +version = "0.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "cc 1.0.48 (registry+https://github.com/rust-lang/crates.io-index)", @@ -696,17 +703,17 @@ dependencies = [ "bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "copyless 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", "fxhash 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", - "gfx-backend-dx11 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)", - "gfx-backend-dx12 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", - "gfx-backend-empty 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", - "gfx-backend-metal 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", - "gfx-backend-vulkan 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", - "gfx-hal 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", + "gfx-backend-dx11 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", + "gfx-backend-dx12 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", + "gfx-backend-empty 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", + "gfx-backend-metal 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", + "gfx-backend-vulkan 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", + "gfx-descriptor 0.1.0", + "gfx-hal 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", + "gfx-memory 0.1.0", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", - "parking_lot 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", + "parking_lot 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)", "peek-poke 0.2.0 (git+https://github.com/kvark/peek-poke?rev=969bd7fe2be1a83f87916dc8b388c63cfd457075)", - "rendy-descriptor 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", - "rendy-memory 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", "smallvec 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "vec_map 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)", @@ -784,7 +791,7 @@ dependencies = [ [metadata] "checksum arrayvec 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "cff77d8686867eceff3105329d4698d96c2391c176d5d03adc90c7389162b5b8" -"checksum ash 0.29.0 (registry+https://github.com/rust-lang/crates.io-index)" = "003d1fb2eb12eb06d4a03dbe02eea67a9fac910fa97932ab9e3a75b96a1ea5e5" +"checksum ash 0.30.0 (registry+https://github.com/rust-lang/crates.io-index)" = "69daec0742947f33a85931fa3cb0ce5f07929159dcbd1f0cbb5b2912e2978509" "checksum atom 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)" = "3c86699c3f02778ec07158376991c8f783dd1f2f95c579ffaf0738dc984b2fe2" "checksum autocfg 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "f8aac770f1885fd7e387acedd76065302551364496e46b3dd00860b2f8359b9d" "checksum battery 0.7.5 (registry+https://github.com/rust-lang/crates.io-index)" = "36a698e449024a5d18994a815998bf5e2e4bc1883e35a7d7ba95b6b69ee45907" @@ -795,23 +802,24 @@ dependencies = [ "checksum cc 1.0.48 (registry+https://github.com/rust-lang/crates.io-index)" = "f52a465a666ca3d838ebbf08b241383421412fe7ebb463527bba275526d89f76" "checksum cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)" = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" "checksum cloudabi 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "ddfc5b9aa5d4507acaf872de71051dfd0e309860e88966e1051e462a077aac4f" -"checksum cocoa 0.19.1 (registry+https://github.com/rust-lang/crates.io-index)" = "f29f7768b2d1be17b96158e3285951d366b40211320fb30826a76cb7a0da6400" -"checksum colorful 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "0bca1619ff57dd7a56b58a8e25ef4199f123e78e503fe1653410350a1b98ae65" +"checksum cocoa 0.20.0 (registry+https://github.com/rust-lang/crates.io-index)" = "0a4736c86d51bd878b474400d9ec888156f4037015f5d09794fab9f26eab1ad4" "checksum copyless 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "6ff9c56c9fb2a49c05ef0e431485a22400af20d33226dc0764d891d09e724127" "checksum core-foundation 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)" = "25b9e03f145fd4f2bf705e07b900cd41fc636598fe5dc452fd0db1441c3f496d" +"checksum core-foundation 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "57d24c7a13c43e870e37c1556b74555437870a04514f7685f5b354e090567171" "checksum core-foundation-sys 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)" = "e7ca8a5221364ef15ce201e8ed2f609fc312682a8f4e0e3d4aa5879764e0fa3b" -"checksum core-graphics 0.17.3 (registry+https://github.com/rust-lang/crates.io-index)" = "56790968ab1c8a1202a102e6de05fc6e1ec87da99e4e93e9a7d13efbfc1e95a9" +"checksum core-foundation-sys 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b3a71ab494c0b5b860bdc8407ae08978052417070c2ced38573a9157ad75b8ac" +"checksum core-graphics 0.19.0 (registry+https://github.com/rust-lang/crates.io-index)" = "59e78b2e0aaf43f08e7ae0d6bc96895ef72ff0921c7d4ff4762201b2dba376dd" "checksum d3d12 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "bc7ed48e89905e5e146bcc1951cc3facb9e44aea9adf5dc01078cda1bd24b662" "checksum foreign-types 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" "checksum foreign-types-shared 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" "checksum fxhash 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "c31b6d751ae2c7f11320402d34e41349dd1016f8d5d45e48c4312bc8625af50c" -"checksum gfx-auxil 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "572eee952a9a23c99cfe3e4fd95d277784058a89ac3c77ff6fa3d80a4e321919" -"checksum gfx-backend-dx11 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)" = "b2cdc732e8cead82f5bfc8ce147ee0a2d8a425342aa7944f1c8f734e53ca3e6b" -"checksum gfx-backend-dx12 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "b6e913cc800fb12eaba2c420091a02aca9aafbefd672600dfc5b52654343d341" -"checksum gfx-backend-empty 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3d383e6bc48867cb37d298a20139fd1eec298f8f6d594690cd1c50ef25470cc7" -"checksum gfx-backend-metal 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "15b8aa3d56d78283546ce51adb3db2826b64232ccea961f1d5c55ce986518632" -"checksum gfx-backend-vulkan 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "62538fedd66a78968a162e8e1a29d085ffbc97f8782634684b2f7da7aea59207" -"checksum gfx-hal 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "7c88981665c780447bb08eb099e1ded330754a7246719bab927ee4a949c0ba7f" +"checksum gfx-auxil 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3b46e6f0031330a0be08d17820f2dcaaa91cb36710a97a9500cb4f1c36e785c8" +"checksum gfx-backend-dx11 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b148219292624126f78245e50a9720d95ea149a415ce8ce73ab7014205301b88" +"checksum gfx-backend-dx12 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "a0e526746379e974501551b08958947e67a81b5ea8cdc717a000cdd72577da05" +"checksum gfx-backend-empty 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b67bd2d7bc022b257ddbdabc5fa3b10c29c292372c3409f2b6a6e3f4e11cdb85" +"checksum gfx-backend-metal 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "6e46f18a5c1b6e5f447ea38ab57154a50a284c3d968c2a587212c9c31c33073e" +"checksum gfx-backend-vulkan 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "2be2520dae207bbdd5eb16da86decbfb57a72bd200ca81480b9a60c7c91eb4b2" +"checksum gfx-hal 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "bc96180204064c9493e0fe4a9efeb721e0ac59fe8e1906d0c659142a93114fb1" "checksum hibitset 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)" = "47e7292fd9f7fe89fa35c98048f2d0a69b79ed243604234d18f6f8a1aa6f408d" "checksum js-sys 0.3.32 (registry+https://github.com/rust-lang/crates.io-index)" = "1c840fdb2167497b0bd0db43d6dfe61e91637fa72f9d061f8bd17ddc44ba6414" "checksum lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" @@ -823,13 +831,15 @@ dependencies = [ "checksum mach 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "86dd2487cdfea56def77b88438a2c915fb45113c5319bfe7e14306ca4cd0b0e1" "checksum malloc_buf 0.0.6 (registry+https://github.com/rust-lang/crates.io-index)" = "62bb907fe88d54d8d9ce32a3cceab4218ed2f6b7d35617cafe9adf84e43919cb" "checksum maybe-uninit 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "60302e4db3a61da70c0cb7991976248362f30319e88850c487b9b95bbf059e00" -"checksum metal 0.17.1 (registry+https://github.com/rust-lang/crates.io-index)" = "f83c7dcc2038e12f68493fa3de44235df27b2497178e257185b4b5b5d028a1e4" +"checksum metal 0.18.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e198a0ee42bdbe9ef2c09d0b9426f3b2b47d90d93a4a9b0395c4cea605e92dc0" "checksum nix 0.15.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3b2e0b4f3320ed72aaedb9a5ac838690a8047c7b275da22711fddff4f8a14229" "checksum num-traits 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)" = "c62be47e61d1842b9170f0fdeec8eba98e60e90e5446449a0545e5152acd7096" "checksum objc 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)" = "915b1b472bc21c53464d6c8461c9d3af805ba1ef837e1cac254428f4a77177b1" "checksum objc_exception 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "ad970fb455818ad6cba4c122ad012fae53ae8b4795f86378bce65e4f6bab2ca4" +"checksum parking_lot 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)" = "92e98c49ab0b7ce5b222f2cc9193fc4efe11c6d0bd4f648e374684a6857b1cfc" "checksum parking_lot 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "f842b1982eb6c2fe34036a4fbfb06dd185a3f5c8edfaacdf7d1ea10b07de6252" "checksum parking_lot_core 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)" = "b876b1b9e7ac6e1a74a6da34d25c42e17e8862aa409cbbbdcfc8d86c6f3bc62b" +"checksum parking_lot_core 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7582838484df45743c8434fbff785e8edf260c28748353d44bc0da32e0ceabf1" "checksum peek-poke 0.2.0 (git+https://github.com/kvark/peek-poke?rev=969bd7fe2be1a83f87916dc8b388c63cfd457075)" = "" "checksum peek-poke-derive 0.2.0 (git+https://github.com/kvark/peek-poke?rev=969bd7fe2be1a83f87916dc8b388c63cfd457075)" = "" "checksum pkg-config 0.3.17 (registry+https://github.com/rust-lang/crates.io-index)" = "05da548ad6865900e60eaba7f589cc0783590a92e940c26953ff81ddbab2d677" @@ -838,20 +848,16 @@ dependencies = [ "checksum range-alloc 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "dd5927936723a9e8b715d37d7e4b390455087c4bdf25b9f702309460577b14f9" "checksum raw-window-handle 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "0a441a7a6c80ad6473bd4b74ec1c9a4c951794285bf941c2126f607c72e48211" "checksum redox_syscall 0.1.56 (registry+https://github.com/rust-lang/crates.io-index)" = "2439c63f3f6139d1b57529d16bc3b8bb855230c8efcc5d3a896c8bea7c3b1e84" -"checksum relevant 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "bbc232e13d37f4547f5b9b42a5efc380cabe5dbc1807f8b893580640b2ab0308" -"checksum rendy-descriptor 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "f475bcc0505946e998590f1f0545c52ef4b559174a1b353a7ce6638def8b621e" -"checksum rendy-memory 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "ed492161a819feae7f27f418bb16035276ac20649c60d756699152cb5c1960ec" "checksum rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "138e3e0acb6c9fb258b19b67cb8abd63c00679d2851805ea151465464fe9030a" "checksum scopeguard 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b42e15e59b18a828bbf5c58ea01debb36b9b096346de35d941dcb89009f24a0d" "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" "checksum serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)" = "1217f97ab8e8904b57dd22eb61cde455fa7446a9c1cf43966066da047c1f3702" "checksum serde_derive 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)" = "a8c6faef9a2e64b0064f48570289b4bf8823b7581f1d6157c1b52152306651d0" -"checksum shared_library 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)" = "5a9e7e0f2bfae24d8a5b5a66c5b257a83c7412304311512a0c054cd5e619da11" "checksum slab 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "c111b5bd5695e56cffe5129854aa230b39c93a305372fdbb2668ca2394eea9f8" "checksum smallvec 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)" = "f7b0758c52e15a8b5e3691eae6cc559f08eee9406e548a4477ba4e67770a82b6" "checksum smallvec 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "4ecf3b85f68e8abaa7555aa5abdb1153079387e60b718283d732f03897fcfc86" -"checksum spirv_cross 0.16.0 (registry+https://github.com/rust-lang/crates.io-index)" = "fbbe441b3ac8ec0ae6a4f05234239bd372a241ce15793eef694e8b24afc267bb" +"checksum spirv_cross 0.18.0 (registry+https://github.com/rust-lang/crates.io-index)" = "946216f8793f7199e3ea5b995ee8dc20a0ace1fcf46293a0ef4c17e1d046dbde" "checksum storage-map 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "fd0a4829a5c591dc24a944a736d6b1e4053e51339a79fd5d4702c4c999a9c45e" "checksum syn 1.0.11 (registry+https://github.com/rust-lang/crates.io-index)" = "dff0acdb207ae2fe6d5976617f887eb1e35a2ba52c13c7234c790960cdad9238" "checksum typenum 1.11.2 (registry+https://github.com/rust-lang/crates.io-index)" = "6d2783fe2d6b8c1101136184eb41be8b1ad379e4657050b8aaff0c79ee7575f9" diff --git a/wgpu-core/Cargo.toml b/wgpu-core/Cargo.toml index 54c685d3f0f..3aa60ee82b3 100644 --- a/wgpu-core/Cargo.toml +++ b/wgpu-core/Cargo.toml @@ -6,7 +6,7 @@ authors = [ "Joshua Groves ", ] edition = "2018" -description = "WebGPU core logic on gfx-hal/rendy" +description = "WebGPU core logic on gfx-hal" homepage = "https://github.com/gfx-rs/wgpu" repository = "https://github.com/gfx-rs/wgpu" keywords = ["graphics"] @@ -27,13 +27,13 @@ bitflags = "1.0" copyless = "0.1" fxhash = "0.2" log = "0.4" -hal = { package = "gfx-hal", version = "0.4" } -gfx-backend-empty = { version = "0.4" } -parking_lot = "0.9" +hal = { package = "gfx-hal", version = "0.5" } +gfx-backend-empty = "0.5" +gfx-descriptor = { version = "0.1", path = "../../gfx-extras/gfx-descriptor" } +gfx-memory = { version = "0.1", path = "../../gfx-extras/gfx-memory" } +parking_lot = "0.10" peek-poke = { git = "https://github.com/kvark/peek-poke", rev = "969bd7fe2be1a83f87916dc8b388c63cfd457075" } -rendy-memory = "0.5" -rendy-descriptor = "0.5" -smallvec = "1.0" +smallvec = "1" vec_map = "0.8" [dependencies.serde_crate] @@ -49,16 +49,16 @@ version = "0.1" features = ["peek-poke"] [target.'cfg(any(target_os = "ios", target_os = "macos"))'.dependencies] -gfx-backend-metal = { version = "0.4" } -gfx-backend-vulkan = { version = "0.4", optional = true } +gfx-backend-metal = { version = "0.5" } +gfx-backend-vulkan = { version = "0.5", optional = true } [target.'cfg(all(unix, not(target_os = "ios"), not(target_os = "macos")))'.dependencies] -gfx-backend-vulkan = { version = "0.4", features = ["x11"] } +gfx-backend-vulkan = { version = "0.5", features = ["x11"] } [target.'cfg(windows)'.dependencies] -gfx-backend-dx12 = { version = "0.4.1" } -gfx-backend-dx11 = { version = "0.4" } -gfx-backend-vulkan = { version = "0.4" } +gfx-backend-dx12 = { version = "0.5" } +gfx-backend-dx11 = { version = "0.5" } +gfx-backend-vulkan = { version = "0.5" } [target.'cfg(any(target_os = "linux", target_os = "macos", target_os = "windows", target_os = "dragonfly", target_os = "freebsd"))'.dependencies] battery = { version = "0.7", optional = true } diff --git a/wgpu-core/src/binding_model.rs b/wgpu-core/src/binding_model.rs index 051ee31ccfd..fdde31df332 100644 --- a/wgpu-core/src/binding_model.rs +++ b/wgpu-core/src/binding_model.rs @@ -13,7 +13,7 @@ use crate::{ use wgt::BufferAddress; use arrayvec::ArrayVec; -use rendy_descriptor::{DescriptorRanges, DescriptorSet}; +use gfx_descriptor::{DescriptorCounts, DescriptorSet}; #[cfg(feature = "serde")] use serde_crate::{Deserialize, Serialize}; @@ -68,7 +68,7 @@ pub struct BindGroupLayout { pub(crate) raw: B::DescriptorSetLayout, pub(crate) device_id: Stored, pub(crate) entries: FastHashMap, - pub(crate) desc_ranges: DescriptorRanges, + pub(crate) desc_counts: DescriptorCounts, pub(crate) dynamic_count: usize, } diff --git a/wgpu-core/src/command/allocator.rs b/wgpu-core/src/command/allocator.rs index 5a30d303ae7..13fd7dff752 100644 --- a/wgpu-core/src/command/allocator.rs +++ b/wgpu-core/src/command/allocator.rs @@ -55,10 +55,8 @@ impl CommandPool { fn allocate(&mut self) -> B::CommandBuffer { if self.available.is_empty() { - let extra = unsafe { self.raw.allocate_vec(20, hal::command::Level::Primary) }; - self.available.extend(extra); + unsafe { self.raw.allocate(20, hal::command::Level::Primary, &mut self.available) }; } - self.available.pop().unwrap() } } @@ -133,8 +131,7 @@ impl CommandAllocator { let pool = inner.pools.get_mut(&cmd_buf.recorded_thread_id).unwrap(); if pool.available.is_empty() { - let extra = unsafe { pool.raw.allocate_vec(20, hal::command::Level::Primary) }; - pool.available.extend(extra); + unsafe { pool.raw.allocate(20, hal::command::Level::Primary, &mut pool.available) }; } pool.available.pop().unwrap() diff --git a/wgpu-core/src/command/compute.rs b/wgpu-core/src/command/compute.rs index 5c728b11517..5de9c410c4a 100644 --- a/wgpu-core/src/command/compute.rs +++ b/wgpu-core/src/command/compute.rs @@ -136,7 +136,7 @@ impl Global { offsets .iter() .chain(follow_ups.flat_map(|(_, offsets)| offsets)) - .map(|&off| off as hal::command::DescriptorSetOffset), + .cloned(), ); } } @@ -173,7 +173,7 @@ impl Global { &pipeline_layout.raw, index, iter::once(desc_set), - offsets.iter().map(|offset| *offset as u32), + offsets.iter().cloned(), ); } } diff --git a/wgpu-core/src/command/render.rs b/wgpu-core/src/command/render.rs index 830f3d4068e..bb0e9454865 100644 --- a/wgpu-core/src/command/render.rs +++ b/wgpu-core/src/command/render.rs @@ -266,7 +266,7 @@ impl State { if bind_mask != 0 { //let (expected, provided) = self.binder.entries[index as usize].info(); return Err(DrawError::IncompatibleBindGroup { - index: bind_mask.trailing_zeros() as u32, + index: bind_mask.trailing_zeros(), }); } if self.blend_color == OptionalState::Required { @@ -335,7 +335,7 @@ impl Global { clear_color: at.clear_color, } }) - .collect::>(); + .collect::>(); let depth_stencil_attachment = if targets.depth_stencil.attachment == id::TextureViewId::ERROR { None } else { @@ -602,7 +602,8 @@ impl Global { } else { let sample_count_check = view_guard[color_attachments[i].attachment].samples; - assert!(sample_count_check > 1, "RenderPassColorAttachmentDescriptor with a resolve_target must have an attachment with sample_count > 1"); + assert!(sample_count_check > 1, + "RenderPassColorAttachmentDescriptor with a resolve_target must have an attachment with sample_count > 1"); resolve_ids.push(( attachment_index, hal::image::Layout::ColorAttachmentOptimal, @@ -845,7 +846,7 @@ impl Global { offsets .iter() .chain(follow_ups.flat_map(|(_, offsets)| offsets)) - .map(|&off| off as hal::command::DescriptorSetOffset), + .cloned() ); } }; @@ -897,7 +898,7 @@ impl Global { &pipeline_layout.raw, index, iter::once(desc_set), - offsets.iter().map(|offset| *offset as u32), + offsets.iter().cloned(), ); } } @@ -922,7 +923,10 @@ impl Global { let view = hal::buffer::IndexBufferView { buffer: &buffer.raw, - offset: range.start, + range: hal::buffer::SubRange { + offset: range.start, + size: Some(range.end - range.start), + }, index_type: conv::map_index_format(state.index.format), }; @@ -960,7 +964,10 @@ impl Global { let view = hal::buffer::IndexBufferView { buffer: &buffer.raw, - offset, + range: hal::buffer::SubRange { + offset, + size: Some(end - offset), + }, index_type: conv::map_index_format(state.index.format), }; @@ -980,8 +987,12 @@ impl Global { buffer.size - offset }; + let range = hal::buffer::SubRange { + offset, + size: if size != 0 { Some(size) } else { None }, + }; unsafe { - raw.bind_vertex_buffers(slot, iter::once((&buffer.raw, offset))); + raw.bind_vertex_buffers(slot, iter::once((&buffer.raw, range))); } state.vertex.update_limits(); } diff --git a/wgpu-core/src/conv.rs b/wgpu-core/src/conv.rs index 2bf74d88ef5..4672fa6a776 100644 --- a/wgpu-core/src/conv.rs +++ b/wgpu-core/src/conv.rs @@ -101,28 +101,61 @@ pub fn map_binding_type( binding: &binding_model::BindGroupLayoutEntry, ) -> hal::pso::DescriptorType { use crate::binding_model::BindingType as Bt; - use hal::pso::DescriptorType as H; + use hal::pso; match binding.ty { Bt::UniformBuffer => { - if binding.has_dynamic_offset { - H::UniformBufferDynamic - } else { - H::UniformBuffer + pso::DescriptorType::Buffer { + ty: pso::BufferDescriptorType::Uniform, + format: pso::BufferDescriptorFormat::Structured { + dynamic_offset: binding.has_dynamic_offset, + }, + } + } + Bt::StorageBuffer => { + pso::DescriptorType::Buffer { + ty: pso::BufferDescriptorType::Storage { + read_only: false, + }, + format: pso::BufferDescriptorFormat::Structured { + dynamic_offset: binding.has_dynamic_offset, + }, } } - Bt::StorageBuffer | Bt::ReadonlyStorageBuffer => { - if binding.has_dynamic_offset { - H::StorageBufferDynamic - } else { - H::StorageBuffer + pso::DescriptorType::Buffer { + ty: pso::BufferDescriptorType::Storage { + read_only: false, + }, + format: pso::BufferDescriptorFormat::Structured { + dynamic_offset: binding.has_dynamic_offset, + }, } } Bt::Sampler | - Bt::ComparisonSampler => H::Sampler, - Bt::SampledTexture => H::SampledImage, - Bt::ReadonlyStorageTexture | - Bt::WriteonlyStorageTexture => H::StorageImage, + Bt::ComparisonSampler => { + pso::DescriptorType::Sampler + } + Bt::SampledTexture => { + pso::DescriptorType::Image { + ty: pso::ImageDescriptorType::Sampled { + with_sampler: false, + }, + } + } + Bt::ReadonlyStorageTexture => { + pso::DescriptorType::Image { + ty: pso::ImageDescriptorType::Storage { + read_only: false, + }, + } + } + Bt::WriteonlyStorageTexture => { + pso::DescriptorType::Image { + ty: pso::ImageDescriptorType::Storage { + read_only: true, + }, + } + } } } @@ -646,23 +679,24 @@ pub fn map_wrap(address: wgt::AddressMode) -> hal::image::WrapMode { pub fn map_rasterization_state_descriptor( desc: &RasterizationStateDescriptor, ) -> hal::pso::Rasterizer { - hal::pso::Rasterizer { + use hal::pso; + pso::Rasterizer { depth_clamping: false, - polygon_mode: hal::pso::PolygonMode::Fill, + polygon_mode: pso::PolygonMode::Fill, cull_face: match desc.cull_mode { - CullMode::None => hal::pso::Face::empty(), - CullMode::Front => hal::pso::Face::FRONT, - CullMode::Back => hal::pso::Face::BACK, + CullMode::None => pso::Face::empty(), + CullMode::Front => pso::Face::FRONT, + CullMode::Back => pso::Face::BACK, }, front_face: match desc.front_face { - FrontFace::Ccw => hal::pso::FrontFace::CounterClockwise, - FrontFace::Cw => hal::pso::FrontFace::Clockwise, + FrontFace::Ccw => pso::FrontFace::CounterClockwise, + FrontFace::Cw => pso::FrontFace::Clockwise, }, depth_bias: if desc.depth_bias != 0 || desc.depth_bias_slope_scale != 0.0 || desc.depth_bias_clamp != 0.0 { - Some(hal::pso::State::Static(hal::pso::DepthBias { + Some(pso::State::Static(pso::DepthBias { const_factor: desc.depth_bias as f32, slope_factor: desc.depth_bias_slope_scale, clamp: desc.depth_bias_clamp, @@ -671,6 +705,7 @@ pub fn map_rasterization_state_descriptor( None }, conservative: false, + line_width: pso::State::Static(1.0), } } diff --git a/wgpu-core/src/device/life.rs b/wgpu-core/src/device/life.rs index 2615cf031b2..5d91d7bb61e 100644 --- a/wgpu-core/src/device/life.rs +++ b/wgpu-core/src/device/life.rs @@ -16,8 +16,8 @@ use crate::{ use copyless::VecHelper as _; use hal::device::Device as _; use parking_lot::Mutex; -use rendy_descriptor::{DescriptorAllocator, DescriptorSet}; -use rendy_memory::{Heaps, MemoryBlock}; +use gfx_descriptor::{DescriptorAllocator, DescriptorSet}; +use gfx_memory::{Heaps, MemoryBlock}; use std::{ sync::atomic::Ordering, @@ -555,10 +555,10 @@ impl LifetimeTracker { let mapping = buffer.pending_mapping.take().unwrap(); let result = match mapping.op { resource::BufferMapOperation::Read(..) => { - super::map_buffer(raw, buffer, mapping.range, super::HostMap::Read) + super::map_buffer(raw, buffer, mapping.sub_range, super::HostMap::Read) } resource::BufferMapOperation::Write(..) => { - super::map_buffer(raw, buffer, mapping.range, super::HostMap::Write) + super::map_buffer(raw, buffer, mapping.sub_range, super::HostMap::Write) } }; (mapping.op, result) diff --git a/wgpu-core/src/device/mod.rs b/wgpu-core/src/device/mod.rs index e9203d3b0ba..dd97c7a1cbd 100644 --- a/wgpu-core/src/device/mod.rs +++ b/wgpu-core/src/device/mod.rs @@ -19,8 +19,11 @@ use crate::{ }; use wgt::{BufferAddress, InputStepMode, TextureDimension, TextureFormat}; + use arrayvec::ArrayVec; use copyless::VecHelper as _; +use gfx_descriptor::DescriptorAllocator; +use gfx_memory::{Block, Heaps}; use hal::{ self, command::CommandBuffer as _, @@ -29,8 +32,6 @@ use hal::{ window::{PresentationSurface as _, Surface as _}, }; use parking_lot::{Mutex, MutexGuard}; -use rendy_descriptor::{DescriptorAllocator, DescriptorRanges}; -use rendy_memory::{Block, Heaps}; use smallvec::SmallVec; use std::{ @@ -38,7 +39,6 @@ use std::{ ffi, iter, marker::PhantomData, - ops, ptr, slice, sync::atomic::Ordering, @@ -118,29 +118,38 @@ pub type BufferMapWriteCallback = fn map_buffer( raw: &B::Device, buffer: &mut resource::Buffer, - buffer_range: ops::Range, + sub_range: hal::buffer::SubRange, kind: HostMap, ) -> BufferMapResult { - let is_coherent = buffer - .memory - .properties() - .contains(hal::memory::Properties::COHERENT); - let (ptr, mapped_range) = { - let mapped = buffer.memory.map(raw, buffer_range)?; - (mapped.ptr(), mapped.range()) + let (ptr, sync_range) = { + let segment = hal::memory::Segment { + offset: sub_range.offset, + size: sub_range.size, + }; + let mapped = buffer.memory.map(raw, segment)?; + let sync_range = if mapped.is_coherent() { + None + } else { + Some(mapped.range()) + }; + (mapped.ptr(), sync_range) }; - if !is_coherent { + if let Some(range) = sync_range { + let segment = hal::memory::Segment { + offset: range.start, + size: Some(range.end - range.start), + }; match kind { HostMap::Read => unsafe { raw.invalidate_mapped_memory_ranges(iter::once(( buffer.memory.memory(), - mapped_range, + segment, ))) .unwrap(); }, HostMap::Write => { - buffer.mapped_write_ranges.push(mapped_range); + buffer.mapped_write_segments.push(segment); } } } @@ -152,21 +161,19 @@ fn unmap_buffer( raw: &B::Device, buffer: &mut resource::Buffer, ) { - if !buffer.mapped_write_ranges.is_empty() { + if !buffer.mapped_write_segments.is_empty() { unsafe { raw .flush_mapped_memory_ranges( buffer - .mapped_write_ranges + .mapped_write_segments .iter() .map(|r| (buffer.memory.memory(), r.clone())), ) .unwrap() }; - buffer.mapped_write_ranges.clear(); + buffer.mapped_write_segments.clear(); } - - buffer.memory.unmap(raw); } //Note: this logic is specifically moved out of `handle_mapping()` in order to @@ -216,6 +223,7 @@ impl Device { adapter_id: id::AdapterId, queue_group: hal::queue::QueueGroup, mem_props: hal::adapter::MemoryProperties, + non_coherent_atom_size: u64, supports_texture_d24_s8: bool, max_bind_groups: u32, ) -> Self { @@ -223,26 +231,19 @@ impl Device { let life_guard = LifeGuard::new(); life_guard.submission_index.fetch_add(1, Ordering::Relaxed); - let heaps = { - let types = mem_props.memory_types.iter().map(|mt| { - use rendy_memory::{DynamicConfig, HeapsConfig, LinearConfig}; - let config = HeapsConfig { - linear: if mt.properties.contains(hal::memory::Properties::CPU_VISIBLE) { - Some(LinearConfig { - linear_size: 0x10_00_00, - }) - } else { - None - }, - dynamic: Some(DynamicConfig { - block_size_granularity: 0x1_00, - max_chunk_size: 0x1_00_00_00, - min_device_allocation: 0x1_00_00, - }), - }; - (mt.properties, mt.heap_index as u32, config) - }); - unsafe { Heaps::new(types, mem_props.memory_heaps.iter().cloned()) } + let heaps = unsafe { + Heaps::new( + &mem_props, + gfx_memory::GeneralConfig { + block_size_granularity: 0x100, + max_chunk_size: 0x100_0000, + min_device_allocation: 0x1_0000, + }, + gfx_memory::LinearConfig { + linear_size: 0x10_0000, + }, + non_coherent_atom_size, + ) }; Device { @@ -302,21 +303,21 @@ impl Device { self_id: id::DeviceId, desc: &wgt::BufferDescriptor, ) -> resource::Buffer { + use gfx_memory::{Kind, MemoryUsage}; + debug_assert_eq!(self_id.backend(), B::VARIANT); let (usage, _memory_properties) = conv::map_buffer_usage(desc.usage); - - let rendy_usage = { - use rendy_memory::MemoryUsageValue as Muv; + let (kind, mem_usage) = { use wgt::BufferUsage as Bu; if !desc.usage.intersects(Bu::MAP_READ | Bu::MAP_WRITE) { - Muv::Data + (Kind::General, MemoryUsage::Private) } else if (Bu::MAP_WRITE | Bu::COPY_SRC).contains(desc.usage) { - Muv::Upload + (Kind::Linear, MemoryUsage::Staging { read_back: false }) } else if (Bu::MAP_READ | Bu::COPY_DST).contains(desc.usage) { - Muv::Download + (Kind::Linear, MemoryUsage::Staging { read_back: true }) } else { - Muv::Dynamic + (Kind::General, MemoryUsage::Dynamic { sparse_updates: false }) } }; @@ -328,7 +329,8 @@ impl Device { .allocate( &self.raw, requirements.type_mask as u32, - rendy_usage, + mem_usage, + kind, requirements.size, requirements.alignment, ) @@ -336,7 +338,11 @@ impl Device { unsafe { self.raw - .bind_buffer_memory(memory.memory(), memory.range().start, &mut buffer) + .bind_buffer_memory( + memory.memory(), + memory.segment().offset, + &mut buffer, + ) .unwrap() }; @@ -350,7 +356,7 @@ impl Device { memory, size: desc.size, full_range: (), - mapped_write_ranges: Vec::new(), + mapped_write_segments: Vec::new(), pending_mapping: None, life_guard: LifeGuard::new(), } @@ -413,7 +419,8 @@ impl Device { .allocate( &self.raw, requirements.type_mask as u32, - rendy_memory::Data, + gfx_memory::MemoryUsage::Private, + gfx_memory::Kind::General, requirements.size, requirements.alignment, ) @@ -421,7 +428,11 @@ impl Device { unsafe { self.raw - .bind_image_memory(memory.memory(), memory.range().start, &mut image) + .bind_image_memory( + memory.memory(), + memory.segment().offset, + &mut image, + ) .unwrap() }; @@ -474,11 +485,11 @@ impl Device { &self.desc_allocator, ); self.com_allocator.destroy(&self.raw); - let desc_alloc = self.desc_allocator.into_inner(); - let mem_alloc = self.mem_allocator.into_inner(); + let mut desc_alloc = self.desc_allocator.into_inner(); + let mut mem_alloc = self.mem_allocator.into_inner(); unsafe { - desc_alloc.dispose(&self.raw); - mem_alloc.dispose(&self.raw); + desc_alloc.clear(&self.raw); + mem_alloc.clear(&self.raw); for (_, rp) in self.render_passes.lock().drain() { self.raw.destroy_render_pass(rp); } @@ -537,7 +548,12 @@ impl Global { let mut buffer = device.create_buffer(device_id, &desc); let ref_count = buffer.life_guard.add_ref(); - let pointer = match map_buffer(&device.raw, &mut buffer, 0 .. desc.size, HostMap::Write) { + let pointer = match map_buffer( + &device.raw, + &mut buffer, + hal::buffer::SubRange::WHOLE, + HostMap::Write, + ) { Ok(ptr) => ptr, Err(e) => { log::error!("failed to create buffer in a mapped state: {:?}", e); @@ -578,7 +594,7 @@ impl Global { match map_buffer( &device.raw, &mut buffer, - offset .. offset + data.len() as BufferAddress, + hal::buffer::SubRange { offset, size: Some(data.len() as BufferAddress) }, HostMap::Write, ) { Ok(ptr) => unsafe { @@ -613,7 +629,7 @@ impl Global { match map_buffer( &device.raw, &mut buffer, - offset .. offset + data.len() as BufferAddress, + hal::buffer::SubRange { offset, size: Some(data.len() as BufferAddress) }, HostMap::Read, ) { Ok(ptr) => unsafe { @@ -823,7 +839,7 @@ impl Global { comparison: desc.compare.cloned().map(conv::map_compare_function), border: hal::image::PackedColor(0), normalized: true, - anisotropic: hal::image::Anisotropic::Off, //TODO + anisotropy_clamp: None, //TODO }; let sampler = resource::Sampler { @@ -917,7 +933,7 @@ impl Global { ref_count: device.life_guard.add_ref(), }, entries: entry_map, - desc_ranges: DescriptorRanges::from_bindings(&raw_bindings), + desc_counts: raw_bindings.iter().cloned().collect(), dynamic_count: entries.iter().filter(|b| b.has_dynamic_offset).count(), }; @@ -1003,7 +1019,7 @@ impl Global { let (bind_group_layout_guard, mut token) = hub.bind_group_layouts.read(&mut token); let bind_group_layout = &bind_group_layout_guard[desc.layout]; let entries = - unsafe { slice::from_raw_parts(desc.entries, desc.entries_length as usize) }; + unsafe { slice::from_raw_parts(desc.entries, desc.entries_length) }; assert_eq!(entries.len(), bind_group_layout.entries.len()); let desc_set = unsafe { @@ -1014,7 +1030,7 @@ impl Global { .allocate( &device.raw, &bind_group_layout.raw, - bind_group_layout.desc_ranges, + &bind_group_layout.desc_counts, 1, &mut desc_sets, ) @@ -1056,7 +1072,7 @@ impl Global { } }; assert_eq!( - bb.offset as hal::buffer::Offset % alignment, + bb.offset % alignment, 0, "Misaligned buffer offset {}", bb.offset @@ -1071,21 +1087,20 @@ impl Global { usage ); - let end = if bb.size == 0 { - None - } else { - let end = bb.offset + bb.size; - assert!( - end <= buffer.size, - "Bound buffer range {:?} does not fit in buffer size {}", - bb.offset .. end, - buffer.size - ); - Some(end) + let sub_range = hal::buffer::SubRange { + offset: bb.offset, + size: if bb.size == 0 { None } else { + let end = bb.offset + bb.size; + assert!( + end <= buffer.size, + "Bound buffer range {:?} does not fit in buffer size {}", + bb.offset .. end, + buffer.size + ); + Some(bb.size) + }, }; - - let range = Some(bb.offset) .. end; - hal::pso::Descriptor::Buffer(&buffer.raw, range) + hal::pso::Descriptor::Buffer(&buffer.raw, sub_range) } binding_model::BindingResource::Sampler(id) => { match decl.ty { @@ -2046,7 +2061,10 @@ impl Global { } buffer.pending_mapping = Some(resource::BufferPendingMapping { - range, + sub_range: hal::buffer::SubRange { + offset: range.start, + size: Some(range.end - range.start), + }, op: operation, parent_ref_count: buffer.life_guard.add_ref(), }); diff --git a/wgpu-core/src/instance.rs b/wgpu-core/src/instance.rs index d0265ab0c50..1b4074fffdb 100644 --- a/wgpu-core/src/instance.rs +++ b/wgpu-core/src/instance.rs @@ -496,6 +496,7 @@ impl Global { adapter_id, gpu.queue_groups.swap_remove(0), mem_props, + limits.non_coherent_atom_size as u64, supports_texture_d24_s8, desc.limits.max_bind_groups, ) diff --git a/wgpu-core/src/lib.rs b/wgpu-core/src/lib.rs index 827ba8fe969..6b13cae72e3 100644 --- a/wgpu-core/src/lib.rs +++ b/wgpu-core/src/lib.rs @@ -2,6 +2,13 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ +#![warn( + trivial_casts, + trivial_numeric_casts, + unused_extern_crates, + unused_qualifications +)] + pub mod backend { #[cfg(windows)] pub use gfx_backend_dx11::Backend as Dx11; diff --git a/wgpu-core/src/resource.rs b/wgpu-core/src/resource.rs index 36c56b5af49..6e2dc162fd2 100644 --- a/wgpu-core/src/resource.rs +++ b/wgpu-core/src/resource.rs @@ -16,8 +16,7 @@ use wgt::{ TextureFormat, TextureUsage, }; -use hal; -use rendy_memory::MemoryBlock; +use gfx_memory::MemoryBlock; use std::{borrow::Borrow, fmt}; @@ -66,7 +65,7 @@ impl BufferMapOperation { #[derive(Debug)] pub struct BufferPendingMapping { - pub range: std::ops::Range, + pub sub_range: hal::buffer::SubRange, pub op: BufferMapOperation, // hold the parent alive while the mapping is active pub parent_ref_count: RefCount, @@ -80,7 +79,7 @@ pub struct Buffer { pub(crate) memory: MemoryBlock, pub(crate) size: BufferAddress, pub(crate) full_range: (), - pub(crate) mapped_write_ranges: Vec>, + pub(crate) mapped_write_segments: Vec, pub(crate) pending_mapping: Option, pub(crate) life_guard: LifeGuard, } diff --git a/wgpu-core/src/track/mod.rs b/wgpu-core/src/track/mod.rs index 1928d671ff0..076fd60f3e8 100644 --- a/wgpu-core/src/track/mod.rs +++ b/wgpu-core/src/track/mod.rs @@ -138,7 +138,7 @@ impl PendingTransition { hal::memory::Barrier::Buffer { states: conv::map_buffer_state(self.usage.start) .. conv::map_buffer_state(self.usage.end), target: &buf.raw, - range: None .. None, + range: hal::buffer::SubRange::WHOLE, families: None, } }