update dependencies

This commit is contained in:
Chad Brokaw 2022-10-19 14:58:54 -04:00
parent f7b1bca18b
commit 14247770aa
12 changed files with 403 additions and 233 deletions

496
Cargo.lock generated
View file

@ -3,10 +3,10 @@
version = 3 version = 3
[[package]] [[package]]
name = "adler32" name = "adler"
version = "1.2.0" version = "1.0.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "aae1277d39aeec15cb388266ecc24b11c80469deae6067e17a1a7aa9e5c1f234" checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe"
[[package]] [[package]]
name = "ansi_term" name = "ansi_term"
@ -31,21 +31,21 @@ checksum = "8da52d66c7071e2e3fa2a1e5c6d088fec47b593032b254f5e980de8ea54454d6"
[[package]] [[package]]
name = "ash" name = "ash"
version = "0.33.3+1.2.191" version = "0.37.0+1.3.209"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cc4f1d82f164f838ae413296d1131aa6fa79b917d25bebaa7033d25620c09219" checksum = "006ca68e0f2b03f22d6fa9f2860f85aed430d257fec20f8879b2145e7c7ae1a6"
dependencies = [ dependencies = [
"libloading", "libloading",
] ]
[[package]] [[package]]
name = "ash-window" name = "ash-window"
version = "0.7.0" version = "0.12.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "12f91ce4c6be1a2ba99d3d6cd57d5bae9ac6d6f903b5ae53d6b1dee2edf872af" checksum = "b912285a7c29f3a8f87ca6f55afc48768624e5e33ec17dbd2f2075903f5e35ab"
dependencies = [ dependencies = [
"ash", "ash",
"raw-window-handle 0.3.4", "raw-window-handle 0.5.0",
"raw-window-metal", "raw-window-metal",
] ]
@ -86,38 +86,35 @@ checksum = "37ccbd214614c6783386c1af30caf03192f17891059cecc394b4fb119e363de3"
[[package]] [[package]]
name = "bytemuck" name = "bytemuck"
version = "1.10.0" version = "1.12.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c53dfa917ec274df8ed3c572698f381a24eef2efba9492d797301b72b6db408a" checksum = "2f5715e491b5a1598fc2bef5a606847b5dc1d48ea625bd3c02c00de8285591da"
dependencies = [ dependencies = [
"bytemuck_derive", "bytemuck_derive",
] ]
[[package]] [[package]]
name = "bytemuck_derive" name = "bytemuck_derive"
version = "1.1.0" version = "1.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "562e382481975bc61d11275ac5e62a19abd00b0547d99516a415336f183dcd0e" checksum = "1b9e1f5fa78f69496407a27ae9ed989e3c3b072310286f5ef385525e4cbc24a9"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn", "syn",
] ]
[[package]]
name = "byteorder"
version = "1.4.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610"
[[package]] [[package]]
name = "calloop" name = "calloop"
version = "0.9.3" version = "0.10.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bf2eec61efe56aa1e813f5126959296933cf0700030e4314786c48779a66ab82" checksum = "a22a6a8f622f797120d452c630b0ab12e1331a1a753e2039ce7868d4ac77b4ee"
dependencies = [ dependencies = [
"log", "log",
"nix", "nix 0.24.2",
"slotmap",
"thiserror",
"vec_map",
] ]
[[package]] [[package]]
@ -126,7 +123,7 @@ version = "0.20.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "51e3973b165dc0f435831a9e426de67e894de532754ff7a3f307c03ee5dec7dc" checksum = "51e3973b165dc0f435831a9e426de67e894de532754ff7a3f307c03ee5dec7dc"
dependencies = [ dependencies = [
"clap", "clap 2.34.0",
"heck", "heck",
"indexmap", "indexmap",
"log", "log",
@ -145,12 +142,6 @@ version = "1.0.73"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2fff2a6927b3bb87f9595d67196a70493f627687a71d87a0d692242c33f58c11" checksum = "2fff2a6927b3bb87f9595d67196a70493f627687a71d87a0d692242c33f58c11"
[[package]]
name = "cfg-if"
version = "0.1.10"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822"
[[package]] [[package]]
name = "cfg-if" name = "cfg-if"
version = "1.0.0" version = "1.0.0"
@ -167,11 +158,35 @@ dependencies = [
"atty", "atty",
"bitflags", "bitflags",
"strsim 0.8.0", "strsim 0.8.0",
"textwrap", "textwrap 0.11.0",
"unicode-width", "unicode-width",
"vec_map", "vec_map",
] ]
[[package]]
name = "clap"
version = "3.2.22"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "86447ad904c7fb335a790c9d7fe3d0d971dc523b8ccd1561a520de9a85302750"
dependencies = [
"atty",
"bitflags",
"clap_lex",
"indexmap",
"strsim 0.10.0",
"termcolor",
"textwrap 0.15.1",
]
[[package]]
name = "clap_lex"
version = "0.2.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2850f2f5a82cbf437dd5af4d49848fbdfc27c157c3d010345776f952765261c5"
dependencies = [
"os_str_bytes",
]
[[package]] [[package]]
name = "cocoa" name = "cocoa"
version = "0.24.0" version = "0.24.0"
@ -181,8 +196,8 @@ dependencies = [
"bitflags", "bitflags",
"block", "block",
"cocoa-foundation", "cocoa-foundation",
"core-foundation 0.9.3", "core-foundation",
"core-graphics 0.22.3", "core-graphics",
"foreign-types", "foreign-types",
"libc", "libc",
"objc", "objc",
@ -196,57 +211,29 @@ checksum = "7ade49b65d560ca58c403a479bb396592b155c0185eada742ee323d1d68d6318"
dependencies = [ dependencies = [
"bitflags", "bitflags",
"block", "block",
"core-foundation 0.9.3", "core-foundation",
"core-graphics-types", "core-graphics-types",
"foreign-types", "foreign-types",
"libc", "libc",
"objc", "objc",
] ]
[[package]]
name = "core-foundation"
version = "0.7.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "57d24c7a13c43e870e37c1556b74555437870a04514f7685f5b354e090567171"
dependencies = [
"core-foundation-sys 0.7.0",
"libc",
]
[[package]] [[package]]
name = "core-foundation" name = "core-foundation"
version = "0.9.3" version = "0.9.3"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "194a7a9e6de53fa55116934067c844d9d749312f75c6f6d0980e8c252f8c2146" checksum = "194a7a9e6de53fa55116934067c844d9d749312f75c6f6d0980e8c252f8c2146"
dependencies = [ dependencies = [
"core-foundation-sys 0.8.3", "core-foundation-sys",
"libc", "libc",
] ]
[[package]]
name = "core-foundation-sys"
version = "0.7.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b3a71ab494c0b5b860bdc8407ae08978052417070c2ced38573a9157ad75b8ac"
[[package]] [[package]]
name = "core-foundation-sys" name = "core-foundation-sys"
version = "0.8.3" version = "0.8.3"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5827cebf4670468b8772dd191856768aedcb1b0278a04f989f7766351917b9dc" checksum = "5827cebf4670468b8772dd191856768aedcb1b0278a04f989f7766351917b9dc"
[[package]]
name = "core-graphics"
version = "0.19.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b3889374e6ea6ab25dba90bb5d96202f61108058361f6dc72e8b03e6f8bbe923"
dependencies = [
"bitflags",
"core-foundation 0.7.0",
"foreign-types",
"libc",
]
[[package]] [[package]]
name = "core-graphics" name = "core-graphics"
version = "0.22.3" version = "0.22.3"
@ -254,7 +241,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2581bbab3b8ffc6fcbd550bf46c355135d16e9ff2a6ea032ad6b9bf1d7efe4fb" checksum = "2581bbab3b8ffc6fcbd550bf46c355135d16e9ff2a6ea032ad6b9bf1d7efe4fb"
dependencies = [ dependencies = [
"bitflags", "bitflags",
"core-foundation 0.9.3", "core-foundation",
"core-graphics-types", "core-graphics-types",
"foreign-types", "foreign-types",
"libc", "libc",
@ -267,31 +254,18 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3a68b68b3446082644c91ac778bf50cd4104bfb002b5a6a7c44cca5a2c70788b" checksum = "3a68b68b3446082644c91ac778bf50cd4104bfb002b5a6a7c44cca5a2c70788b"
dependencies = [ dependencies = [
"bitflags", "bitflags",
"core-foundation 0.9.3", "core-foundation",
"foreign-types", "foreign-types",
"libc", "libc",
] ]
[[package]]
name = "core-video-sys"
version = "0.1.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "34ecad23610ad9757664d644e369246edde1803fcb43ed72876565098a5d3828"
dependencies = [
"cfg-if 0.1.10",
"core-foundation-sys 0.7.0",
"core-graphics 0.19.2",
"libc",
"objc",
]
[[package]] [[package]]
name = "crc32fast" name = "crc32fast"
version = "1.3.2" version = "1.3.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b540bd8bc810d3885c6ea91e2018302f68baba2129ab3e88f32389ee9370880d" checksum = "b540bd8bc810d3885c6ea91e2018302f68baba2129ab3e88f32389ee9370880d"
dependencies = [ dependencies = [
"cfg-if 1.0.0", "cfg-if",
] ]
[[package]] [[package]]
@ -370,16 +344,6 @@ dependencies = [
"syn", "syn",
] ]
[[package]]
name = "deflate"
version = "0.8.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "73770f8e1fe7d64df17ca66ad28994a0a623ea497fa69486e14984e715c5d174"
dependencies = [
"adler32",
"byteorder",
]
[[package]] [[package]]
name = "dispatch" name = "dispatch"
version = "0.2.0" version = "0.2.0"
@ -410,6 +374,16 @@ dependencies = [
"instant", "instant",
] ]
[[package]]
name = "flate2"
version = "1.0.24"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f82b0f4c27ad9f8bfd1f3208d882da2b09c301bc1c828fd3a00d0216d2fbbff6"
dependencies = [
"crc32fast",
"miniz_oxide",
]
[[package]] [[package]]
name = "fnv" name = "fnv"
version = "1.0.7" version = "1.0.7"
@ -437,11 +411,22 @@ version = "0.1.16"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8fc3cb4d91f53b50155bdcfd23f6a4c39ae1969c2ae85982b135750cccaf5fce" checksum = "8fc3cb4d91f53b50155bdcfd23f6a4c39ae1969c2ae85982b135750cccaf5fce"
dependencies = [ dependencies = [
"cfg-if 1.0.0", "cfg-if",
"libc", "libc",
"wasi 0.9.0+wasi-snapshot-preview1", "wasi 0.9.0+wasi-snapshot-preview1",
] ]
[[package]]
name = "getrandom"
version = "0.2.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4eb1a864a501629691edf6c15a593b7a51eebaa1e8468e9ddc623de7c9b58ec6"
dependencies = [
"cfg-if",
"libc",
"wasi 0.11.0+wasi-snapshot-preview1",
]
[[package]] [[package]]
name = "half" name = "half"
version = "1.8.2" version = "1.8.2"
@ -494,7 +479,7 @@ version = "0.1.12"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c"
dependencies = [ dependencies = [
"cfg-if 1.0.0", "cfg-if",
"js-sys", "js-sys",
"wasm-bindgen", "wasm-bindgen",
"web-sys", "web-sys",
@ -557,7 +542,7 @@ version = "0.7.3"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "efbc0f03f9a775e9f6aed295c6a1ba2253c5757a9e03d55c6caa46a681abcddd" checksum = "efbc0f03f9a775e9f6aed295c6a1ba2253c5757a9e03d55c6caa46a681abcddd"
dependencies = [ dependencies = [
"cfg-if 1.0.0", "cfg-if",
"winapi", "winapi",
] ]
@ -577,7 +562,7 @@ version = "0.4.17"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "abb12e687cfb44aa40f41fc3978ef76448f9b6038cad6aef4259d3c095a2382e" checksum = "abb12e687cfb44aa40f41fc3978ef76448f9b6038cad6aef4259d3c095a2382e"
dependencies = [ dependencies = [
"cfg-if 1.0.0", "cfg-if",
] ]
[[package]] [[package]]
@ -597,9 +582,9 @@ checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d"
[[package]] [[package]]
name = "memmap2" name = "memmap2"
version = "0.3.1" version = "0.5.7"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "00b6c2ebff6180198788f5db08d7ce3bc1d0b617176678831a7510825973e357" checksum = "95af15f345b17af2efc8ead6080fb8bc376f8cec1b35277b935637595fe77498"
dependencies = [ dependencies = [
"libc", "libc",
] ]
@ -627,6 +612,20 @@ dependencies = [
"objc", "objc",
] ]
[[package]]
name = "metal"
version = "0.24.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "de11355d1f6781482d027a3b4d4de7825dcedb197bf573e0596d00008402d060"
dependencies = [
"bitflags",
"block",
"core-graphics-types",
"foreign-types",
"log",
"objc",
]
[[package]] [[package]]
name = "minimal-lexical" name = "minimal-lexical"
version = "0.2.1" version = "0.2.1"
@ -635,11 +634,11 @@ checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a"
[[package]] [[package]]
name = "miniz_oxide" name = "miniz_oxide"
version = "0.3.7" version = "0.5.4"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "791daaae1ed6889560f8c4359194f56648355540573244a5448a83ba1ecc7435" checksum = "96590ba8f175222643a85693f33d26e9c8a015f599c216509b1a6894af675d34"
dependencies = [ dependencies = [
"adler32", "adler",
] ]
[[package]] [[package]]
@ -651,7 +650,7 @@ dependencies = [
"libc", "libc",
"log", "log",
"wasi 0.11.0+wasi-snapshot-preview1", "wasi 0.11.0+wasi-snapshot-preview1",
"windows-sys", "windows-sys 0.36.1",
] ]
[[package]] [[package]]
@ -669,21 +668,22 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8794322172319b972f528bf90c6b467be0079f1fa82780ffb431088e741a73ab" checksum = "8794322172319b972f528bf90c6b467be0079f1fa82780ffb431088e741a73ab"
dependencies = [ dependencies = [
"jni-sys", "jni-sys",
"ndk-sys", "ndk-sys 0.2.2",
"num_enum", "num_enum",
"thiserror", "thiserror",
] ]
[[package]] [[package]]
name = "ndk" name = "ndk"
version = "0.5.0" version = "0.7.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "96d868f654c72e75f8687572699cdabe755f03effbb62542768e995d5b8d699d" checksum = "451422b7e4718271c8b5b3aadf5adedba43dc76312454b387e98fae0fc951aa0"
dependencies = [ dependencies = [
"bitflags", "bitflags",
"jni-sys", "jni-sys",
"ndk-sys", "ndk-sys 0.4.0",
"num_enum", "num_enum",
"raw-window-handle 0.5.0",
"thiserror", "thiserror",
] ]
@ -704,22 +704,23 @@ dependencies = [
"log", "log",
"ndk 0.3.0", "ndk 0.3.0",
"ndk-macro 0.2.0", "ndk-macro 0.2.0",
"ndk-sys", "ndk-sys 0.2.2",
] ]
[[package]] [[package]]
name = "ndk-glue" name = "ndk-glue"
version = "0.5.2" version = "0.7.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c71bee8ea72d685477e28bd004cfe1bf99c754d688cd78cad139eae4089484d4" checksum = "0434fabdd2c15e0aab768ca31d5b7b333717f03cf02037d5a0a3ff3c278ed67f"
dependencies = [ dependencies = [
"lazy_static",
"libc", "libc",
"log", "log",
"ndk 0.5.0", "ndk 0.7.0",
"ndk-context", "ndk-context",
"ndk-macro 0.3.0", "ndk-macro 0.3.0",
"ndk-sys", "ndk-sys 0.4.0",
"once_cell",
"parking_lot",
] ]
[[package]] [[package]]
@ -754,6 +755,15 @@ version = "0.2.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e1bcdd74c20ad5d95aacd60ef9ba40fdf77f767051040541df557b7a9b2a2121" checksum = "e1bcdd74c20ad5d95aacd60ef9ba40fdf77f767051040541df557b7a9b2a2121"
[[package]]
name = "ndk-sys"
version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "21d83ec9c63ec5bf950200a8e508bdad6659972187b625469f58ef8c08e29046"
dependencies = [
"jni-sys",
]
[[package]] [[package]]
name = "nix" name = "nix"
version = "0.22.3" version = "0.22.3"
@ -762,7 +772,19 @@ checksum = "e4916f159ed8e5de0082076562152a76b7a1f64a01fd9d1e0fea002c37624faf"
dependencies = [ dependencies = [
"bitflags", "bitflags",
"cc", "cc",
"cfg-if 1.0.0", "cfg-if",
"libc",
"memoffset",
]
[[package]]
name = "nix"
version = "0.24.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "195cdbc1741b8134346d515b3a56a1c94b0912758009cfd53f99ea0f57b065fc"
dependencies = [
"bitflags",
"cfg-if",
"libc", "libc",
"memoffset", "memoffset",
] ]
@ -824,28 +846,32 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "18a6dbe30758c9f83eb00cbea4ac95966305f5a7772f3f42ebfc7fc7eddbd8e1" checksum = "18a6dbe30758c9f83eb00cbea4ac95966305f5a7772f3f42ebfc7fc7eddbd8e1"
[[package]] [[package]]
name = "parking_lot" name = "os_str_bytes"
version = "0.11.2" version = "6.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7d17b78036a60663b797adeaee46f5c9dfebb86948d1255007a1d6be0271ff99" checksum = "9ff7415e9ae3fff1225851df9e0d9e4e5479f947619774677a63572e55e80eff"
[[package]]
name = "parking_lot"
version = "0.12.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f"
dependencies = [ dependencies = [
"instant",
"lock_api", "lock_api",
"parking_lot_core", "parking_lot_core",
] ]
[[package]] [[package]]
name = "parking_lot_core" name = "parking_lot_core"
version = "0.8.5" version = "0.9.4"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d76e8e1493bcac0d2766c42737f34458f1c8c50c0d23bcb24ea953affb273216" checksum = "4dc9e0dc2adc1c69d09143aff38d3d30c5c3f0df0dad82e6d25547af174ebec0"
dependencies = [ dependencies = [
"cfg-if 1.0.0", "cfg-if",
"instant",
"libc", "libc",
"redox_syscall", "redox_syscall",
"smallvec", "smallvec",
"winapi", "windows-sys 0.42.0",
] ]
[[package]] [[package]]
@ -860,7 +886,7 @@ version = "0.1.0"
dependencies = [ dependencies = [
"cbindgen", "cbindgen",
"cocoa", "cocoa",
"metal", "metal 0.22.0",
"objc", "objc",
"piet-gpu", "piet-gpu",
"piet-gpu-hal", "piet-gpu-hal",
@ -872,17 +898,18 @@ name = "piet-gpu"
version = "0.1.0" version = "0.1.0"
dependencies = [ dependencies = [
"bytemuck", "bytemuck",
"clap", "clap 3.2.22",
"kurbo 0.8.3", "kurbo 0.8.3",
"ndk 0.3.0", "ndk 0.3.0",
"ndk-glue 0.3.0", "ndk-glue 0.3.0",
"ndk-sys", "ndk-sys 0.2.2",
"piet-gpu-hal", "piet-gpu-hal",
"piet-gpu-types", "piet-gpu-types",
"piet-scene", "piet-scene",
"png", "png",
"rand", "rand 0.8.5",
"raw-window-handle 0.3.4", "raw-window-handle 0.3.4",
"raw-window-handle 0.5.0",
"roxmltree", "roxmltree",
"winit", "winit",
] ]
@ -906,10 +933,11 @@ dependencies = [
"block", "block",
"bytemuck", "bytemuck",
"cocoa-foundation", "cocoa-foundation",
"core-graphics-types",
"foreign-types", "foreign-types",
"metal", "metal 0.24.0",
"objc", "objc",
"raw-window-handle 0.3.4", "raw-window-handle 0.5.0",
"smallvec", "smallvec",
"winapi", "winapi",
"wio", "wio",
@ -920,11 +948,11 @@ name = "piet-gpu-tests"
version = "0.1.0" version = "0.1.0"
dependencies = [ dependencies = [
"bytemuck", "bytemuck",
"clap", "clap 2.34.0",
"kurbo 0.7.1", "kurbo 0.7.1",
"piet-gpu", "piet-gpu",
"piet-gpu-hal", "piet-gpu-hal",
"rand", "rand 0.7.3",
] ]
[[package]] [[package]]
@ -959,13 +987,13 @@ checksum = "1df8c4ec4b0627e53bdf214615ad287367e482558cf84b109250b37464dc03ae"
[[package]] [[package]]
name = "png" name = "png"
version = "0.16.8" version = "0.17.6"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3c3287920cb847dee3de33d301c463fba14dda99db24214ddf93f83d3021f4c6" checksum = "8f0e7f4c94ec26ff209cee506314212639d6c91b80afb82984819fafce9df01c"
dependencies = [ dependencies = [
"bitflags", "bitflags",
"crc32fast", "crc32fast",
"deflate", "flate2",
"miniz_oxide", "miniz_oxide",
] ]
@ -996,9 +1024,9 @@ dependencies = [
[[package]] [[package]]
name = "proc-macro2" name = "proc-macro2"
version = "1.0.40" version = "1.0.47"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "dd96a1e8ed2596c337f8eae5f24924ec83f5ad5ab21ea8e455d3566c69fbcaf7" checksum = "5ea3d908b0e36316caf9e9e2c4625cdde190a7e6f440d794667ed17a1855e725"
dependencies = [ dependencies = [
"unicode-ident", "unicode-ident",
] ]
@ -1018,13 +1046,24 @@ version = "0.7.3"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6a6b1679d49b24bbfe0c803429aa1874472f50d9b363131f0e89fc356b544d03" checksum = "6a6b1679d49b24bbfe0c803429aa1874472f50d9b363131f0e89fc356b544d03"
dependencies = [ dependencies = [
"getrandom", "getrandom 0.1.16",
"libc", "libc",
"rand_chacha", "rand_chacha 0.2.2",
"rand_core", "rand_core 0.5.1",
"rand_hc", "rand_hc",
] ]
[[package]]
name = "rand"
version = "0.8.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404"
dependencies = [
"libc",
"rand_chacha 0.3.1",
"rand_core 0.6.4",
]
[[package]] [[package]]
name = "rand_chacha" name = "rand_chacha"
version = "0.2.2" version = "0.2.2"
@ -1032,7 +1071,17 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f4c8ed856279c9737206bf725bf36935d8666ead7aa69b52be55af369d193402" checksum = "f4c8ed856279c9737206bf725bf36935d8666ead7aa69b52be55af369d193402"
dependencies = [ dependencies = [
"ppv-lite86", "ppv-lite86",
"rand_core", "rand_core 0.5.1",
]
[[package]]
name = "rand_chacha"
version = "0.3.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88"
dependencies = [
"ppv-lite86",
"rand_core 0.6.4",
] ]
[[package]] [[package]]
@ -1041,7 +1090,16 @@ version = "0.5.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19" checksum = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19"
dependencies = [ dependencies = [
"getrandom", "getrandom 0.1.16",
]
[[package]]
name = "rand_core"
version = "0.6.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c"
dependencies = [
"getrandom 0.2.7",
] ]
[[package]] [[package]]
@ -1050,7 +1108,7 @@ version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ca3129af7b92a17112d59ad498c6f81eaf463253766b90396d39ea7a39d6613c" checksum = "ca3129af7b92a17112d59ad498c6f81eaf463253766b90396d39ea7a39d6613c"
dependencies = [ dependencies = [
"rand_core", "rand_core 0.5.1",
] ]
[[package]] [[package]]
@ -1073,15 +1131,24 @@ dependencies = [
] ]
[[package]] [[package]]
name = "raw-window-metal" name = "raw-window-handle"
version = "0.1.2" version = "0.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2cd21ed1cdef7f1b1579b972148ba6058b5b545959a14d91ea83c4f0ea9f289b" checksum = "ed7e3d950b66e19e0c372f3fa3fbbcf85b1746b571f74e0c2af6042a5c93420a"
dependencies = [
"cty",
]
[[package]]
name = "raw-window-metal"
version = "0.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5d18241d631f19847a5f4cc0a3f81d978202c375573ab7d90ab14dcf0a9262ec"
dependencies = [ dependencies = [
"cocoa", "cocoa",
"core-graphics 0.22.3", "core-graphics",
"objc", "objc",
"raw-window-handle 0.3.4", "raw-window-handle 0.5.0",
] ]
[[package]] [[package]]
@ -1160,6 +1227,15 @@ dependencies = [
"serde", "serde",
] ]
[[package]]
name = "slotmap"
version = "1.0.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e1e08e261d0e8f5c43123b7adf3e4ca1690d655377ac93a03b2c9d3e98de1342"
dependencies = [
"version_check",
]
[[package]] [[package]]
name = "smallvec" name = "smallvec"
version = "1.9.0" version = "1.9.0"
@ -1168,9 +1244,9 @@ checksum = "2fd0db749597d91ff862fd1d55ea87f7855a744a8425a64695b6fca237d1dad1"
[[package]] [[package]]
name = "smithay-client-toolkit" name = "smithay-client-toolkit"
version = "0.15.4" version = "0.16.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8a28f16a97fa0e8ce563b2774d1e732dd5d4025d2772c5dba0a41a0f90a29da3" checksum = "f307c47d32d2715eb2e0ece5589057820e0e5e70d07c247d1063e844e107f454"
dependencies = [ dependencies = [
"bitflags", "bitflags",
"calloop", "calloop",
@ -1178,7 +1254,7 @@ dependencies = [
"lazy_static", "lazy_static",
"log", "log",
"memmap2", "memmap2",
"nix", "nix 0.24.2",
"pkg-config", "pkg-config",
"wayland-client", "wayland-client",
"wayland-cursor", "wayland-cursor",
@ -1205,9 +1281,9 @@ checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623"
[[package]] [[package]]
name = "syn" name = "syn"
version = "1.0.98" version = "1.0.102"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c50aef8a904de4c23c788f104b7dddc7d6f79c647c7c8ce4cc8f73eb0ca773dd" checksum = "3fcd952facd492f9be3ef0d0b7032a6e442ee9b361d4acc2b1d0c4aaa5f613a1"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
@ -1220,7 +1296,7 @@ version = "3.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5cdb1ef4eaeeaddc8fbd371e5017057064af0911902ef36b39801f67cc6d79e4" checksum = "5cdb1ef4eaeeaddc8fbd371e5017057064af0911902ef36b39801f67cc6d79e4"
dependencies = [ dependencies = [
"cfg-if 1.0.0", "cfg-if",
"fastrand", "fastrand",
"libc", "libc",
"redox_syscall", "redox_syscall",
@ -1228,6 +1304,15 @@ dependencies = [
"winapi", "winapi",
] ]
[[package]]
name = "termcolor"
version = "1.1.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bab24d30b911b2376f3a13cc2cd443142f0c81dda04c118693e35b3835757755"
dependencies = [
"winapi-util",
]
[[package]] [[package]]
name = "textwrap" name = "textwrap"
version = "0.11.0" version = "0.11.0"
@ -1237,6 +1322,12 @@ dependencies = [
"unicode-width", "unicode-width",
] ]
[[package]]
name = "textwrap"
version = "0.15.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "949517c0cf1bf4ee812e2e07e08ab448e3ae0d23472aee8a06c985f0c8815b16"
[[package]] [[package]]
name = "thiserror" name = "thiserror"
version = "1.0.31" version = "1.0.31"
@ -1290,6 +1381,12 @@ version = "0.8.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f1bddf1187be692e79c5ffeab891132dfb0f236ed36a43c7ed39f1165ee20191" checksum = "f1bddf1187be692e79c5ffeab891132dfb0f236ed36a43c7ed39f1165ee20191"
[[package]]
name = "version_check"
version = "0.9.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f"
[[package]] [[package]]
name = "wasi" name = "wasi"
version = "0.9.0+wasi-snapshot-preview1" version = "0.9.0+wasi-snapshot-preview1"
@ -1308,7 +1405,7 @@ version = "0.2.81"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7c53b543413a17a202f4be280a7e5c62a1c69345f5de525ee64f8cfdbc954994" checksum = "7c53b543413a17a202f4be280a7e5c62a1c69345f5de525ee64f8cfdbc954994"
dependencies = [ dependencies = [
"cfg-if 1.0.0", "cfg-if",
"wasm-bindgen-macro", "wasm-bindgen-macro",
] ]
@ -1365,7 +1462,7 @@ dependencies = [
"bitflags", "bitflags",
"downcast-rs", "downcast-rs",
"libc", "libc",
"nix", "nix 0.22.3",
"scoped-tls", "scoped-tls",
"wayland-commons", "wayland-commons",
"wayland-scanner", "wayland-scanner",
@ -1378,7 +1475,7 @@ version = "0.29.4"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "94f6e5e340d7c13490eca867898c4cec5af56c27a5ffe5c80c6fc4708e22d33e" checksum = "94f6e5e340d7c13490eca867898c4cec5af56c27a5ffe5c80c6fc4708e22d33e"
dependencies = [ dependencies = [
"nix", "nix 0.22.3",
"once_cell", "once_cell",
"smallvec", "smallvec",
"wayland-sys", "wayland-sys",
@ -1390,7 +1487,7 @@ version = "0.29.4"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c52758f13d5e7861fc83d942d3d99bf270c83269575e52ac29e5b73cb956a6bd" checksum = "c52758f13d5e7861fc83d942d3d99bf270c83269575e52ac29e5b73cb956a6bd"
dependencies = [ dependencies = [
"nix", "nix 0.22.3",
"wayland-client", "wayland-client",
"xcursor", "xcursor",
] ]
@ -1455,6 +1552,15 @@ version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6"
[[package]]
name = "winapi-util"
version = "0.1.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178"
dependencies = [
"winapi",
]
[[package]] [[package]]
name = "winapi-x86_64-pc-windows-gnu" name = "winapi-x86_64-pc-windows-gnu"
version = "0.4.0" version = "0.4.0"
@ -1467,37 +1573,88 @@ version = "0.36.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ea04155a16a59f9eab786fe12a4a450e75cdb175f9e0d80da1e17db09f55b8d2" checksum = "ea04155a16a59f9eab786fe12a4a450e75cdb175f9e0d80da1e17db09f55b8d2"
dependencies = [ dependencies = [
"windows_aarch64_msvc", "windows_aarch64_msvc 0.36.1",
"windows_i686_gnu", "windows_i686_gnu 0.36.1",
"windows_i686_msvc", "windows_i686_msvc 0.36.1",
"windows_x86_64_gnu", "windows_x86_64_gnu 0.36.1",
"windows_x86_64_msvc", "windows_x86_64_msvc 0.36.1",
] ]
[[package]]
name = "windows-sys"
version = "0.42.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5a3e1820f08b8513f676f7ab6c1f99ff312fb97b553d30ff4dd86f9f15728aa7"
dependencies = [
"windows_aarch64_gnullvm",
"windows_aarch64_msvc 0.42.0",
"windows_i686_gnu 0.42.0",
"windows_i686_msvc 0.42.0",
"windows_x86_64_gnu 0.42.0",
"windows_x86_64_gnullvm",
"windows_x86_64_msvc 0.42.0",
]
[[package]]
name = "windows_aarch64_gnullvm"
version = "0.42.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "41d2aa71f6f0cbe00ae5167d90ef3cfe66527d6f613ca78ac8024c3ccab9a19e"
[[package]] [[package]]
name = "windows_aarch64_msvc" name = "windows_aarch64_msvc"
version = "0.36.1" version = "0.36.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9bb8c3fd39ade2d67e9874ac4f3db21f0d710bee00fe7cab16949ec184eeaa47" checksum = "9bb8c3fd39ade2d67e9874ac4f3db21f0d710bee00fe7cab16949ec184eeaa47"
[[package]]
name = "windows_aarch64_msvc"
version = "0.42.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "dd0f252f5a35cac83d6311b2e795981f5ee6e67eb1f9a7f64eb4500fbc4dcdb4"
[[package]] [[package]]
name = "windows_i686_gnu" name = "windows_i686_gnu"
version = "0.36.1" version = "0.36.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "180e6ccf01daf4c426b846dfc66db1fc518f074baa793aa7d9b9aaeffad6a3b6" checksum = "180e6ccf01daf4c426b846dfc66db1fc518f074baa793aa7d9b9aaeffad6a3b6"
[[package]]
name = "windows_i686_gnu"
version = "0.42.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fbeae19f6716841636c28d695375df17562ca208b2b7d0dc47635a50ae6c5de7"
[[package]] [[package]]
name = "windows_i686_msvc" name = "windows_i686_msvc"
version = "0.36.1" version = "0.36.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e2e7917148b2812d1eeafaeb22a97e4813dfa60a3f8f78ebe204bcc88f12f024" checksum = "e2e7917148b2812d1eeafaeb22a97e4813dfa60a3f8f78ebe204bcc88f12f024"
[[package]]
name = "windows_i686_msvc"
version = "0.42.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "84c12f65daa39dd2babe6e442988fc329d6243fdce47d7d2d155b8d874862246"
[[package]] [[package]]
name = "windows_x86_64_gnu" name = "windows_x86_64_gnu"
version = "0.36.1" version = "0.36.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4dcd171b8776c41b97521e5da127a2d86ad280114807d0b2ab1e462bc764d9e1" checksum = "4dcd171b8776c41b97521e5da127a2d86ad280114807d0b2ab1e462bc764d9e1"
[[package]]
name = "windows_x86_64_gnu"
version = "0.42.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bf7b1b21b5362cbc318f686150e5bcea75ecedc74dd157d874d754a2ca44b0ed"
[[package]]
name = "windows_x86_64_gnullvm"
version = "0.42.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "09d525d2ba30eeb3297665bd434a54297e4170c7f1a44cad4ef58095b4cd2028"
[[package]] [[package]]
name = "windows_x86_64_msvc" name = "windows_x86_64_msvc"
version = "0.36.1" version = "0.36.1"
@ -1505,35 +1662,40 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c811ca4a8c853ef420abd8592ba53ddbbac90410fab6903b3e79972a631f7680" checksum = "c811ca4a8c853ef420abd8592ba53ddbbac90410fab6903b3e79972a631f7680"
[[package]] [[package]]
name = "winit" name = "windows_x86_64_msvc"
version = "0.26.1" version = "0.42.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9b43cc931d58b99461188607efd7acb2a093e65fc621f54cad78517a6063e73a" checksum = "f40009d85759725a34da6d89a94e63d7bdc50a862acf0dbc7c8e488f1edcb6f5"
[[package]]
name = "winit"
version = "0.27.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "37f64802920c4c35d12a53dad5e0c55bbc3004d8dc4f2e4dd64ad02c5665d7aa"
dependencies = [ dependencies = [
"bitflags", "bitflags",
"cocoa", "cocoa",
"core-foundation 0.9.3", "core-foundation",
"core-graphics 0.22.3", "core-graphics",
"core-video-sys",
"dispatch", "dispatch",
"instant", "instant",
"lazy_static",
"libc", "libc",
"log", "log",
"mio", "mio",
"ndk 0.5.0", "ndk 0.7.0",
"ndk-glue 0.5.2", "ndk-glue 0.7.0",
"ndk-sys",
"objc", "objc",
"once_cell",
"parking_lot", "parking_lot",
"percent-encoding", "percent-encoding",
"raw-window-handle 0.4.3", "raw-window-handle 0.4.3",
"raw-window-handle 0.5.0",
"smithay-client-toolkit", "smithay-client-toolkit",
"wasm-bindgen", "wasm-bindgen",
"wayland-client", "wayland-client",
"wayland-protocols", "wayland-protocols",
"web-sys", "web-sys",
"winapi", "windows-sys 0.36.1",
"x11-dl", "x11-dl",
] ]

View file

@ -7,12 +7,12 @@ license = "MIT/Apache-2.0"
edition = "2018" edition = "2018"
[dependencies] [dependencies]
ash = "0.33" ash = { version = "0.37", features = ["loaded"] }
ash-window = "0.7" ash-window = "0.12"
raw-window-handle = "0.3" raw-window-handle = "0.5"
bitflags = "1.2.1" bitflags = "1.3.2"
smallvec = "1.6.1" smallvec = "1.9"
bytemuck = "1.7.2" bytemuck = "1.12.1"
[target.'cfg(target_os="windows")'.dependencies] [target.'cfg(target_os="windows")'.dependencies]
winapi = { version = "0.3.9", features = [ winapi = { version = "0.3.9", features = [
@ -24,8 +24,10 @@ winapi = { version = "0.3.9", features = [
wio = "0.2.2" wio = "0.2.2"
[target.'cfg(target_os="macos")'.dependencies] [target.'cfg(target_os="macos")'.dependencies]
metal = "0.22" metal = "0.24"
objc = "0.2.5" objc = "0.2.7"
block = "0.1.6" block = "0.1.6"
cocoa-foundation = "0.1" cocoa-foundation = "0.1"
# Note: foreign-types is up to 0.5 but metal hasn't upgraded to it
foreign-types = "0.3.2" foreign-types = "0.3.2"
core-graphics-types = "0.1.1"

View file

@ -17,7 +17,7 @@ use winapi::shared::minwindef::TRUE;
use winapi::shared::{dxgi, dxgi1_2, dxgitype}; use winapi::shared::{dxgi, dxgi1_2, dxgitype};
use winapi::um::d3d12; use winapi::um::d3d12;
use raw_window_handle::{HasRawWindowHandle, RawWindowHandle}; use raw_window_handle::{RawDisplayHandle, RawWindowHandle};
use smallvec::SmallVec; use smallvec::SmallVec;
@ -153,9 +153,10 @@ impl Dx12Instance {
/// Create a surface for the specified window handle. /// Create a surface for the specified window handle.
pub fn surface( pub fn surface(
&self, &self,
window_handle: &dyn HasRawWindowHandle, _display_handle: RawDisplayHandle,
window_handle: RawWindowHandle,
) -> Result<Dx12Surface, Error> { ) -> Result<Dx12Surface, Error> {
if let RawWindowHandle::Windows(w) = window_handle.raw_window_handle() { if let RawWindowHandle::Win32(w) = window_handle {
let hwnd = w.hwnd as *mut _; let hwnd = w.hwnd as *mut _;
Ok(Dx12Surface { hwnd }) Ok(Dx12Surface { hwnd })
} else { } else {

View file

@ -98,7 +98,7 @@ pub enum ImageFormat {
A8, A8,
// 8 bit per pixel RGBA // 8 bit per pixel RGBA
Rgba8, Rgba8,
// Match default surface format // Format that matches the target surface
Surface, Surface,
} }

View file

@ -29,9 +29,10 @@ use objc::rc::autoreleasepool;
use objc::runtime::{Object, BOOL, YES}; use objc::runtime::{Object, BOOL, YES};
use objc::{class, msg_send, sel, sel_impl}; use objc::{class, msg_send, sel, sel_impl};
use metal::{CGFloat, CommandBufferRef, MTLFeatureSet}; use core_graphics_types::base::CGFloat;
use metal::{CommandBufferRef, MTLFeatureSet};
use raw_window_handle::{HasRawWindowHandle, RawWindowHandle}; use raw_window_handle::{RawDisplayHandle, RawWindowHandle};
use crate::{ use crate::{
BufferUsage, ComputePassDescriptor, Error, GpuInfo, ImageFormat, MapMode, WorkgroupLimits, BufferUsage, ComputePassDescriptor, Error, GpuInfo, ImageFormat, MapMode, WorkgroupLimits,
@ -139,9 +140,10 @@ impl MtlInstance {
pub unsafe fn surface( pub unsafe fn surface(
&self, &self,
window_handle: &dyn HasRawWindowHandle, _display_handle: RawDisplayHandle,
window_handle: RawWindowHandle,
) -> Result<MtlSurface, Error> { ) -> Result<MtlSurface, Error> {
if let RawWindowHandle::MacOS(handle) = window_handle.raw_window_handle() { if let RawWindowHandle::AppKit(handle) = window_handle {
Ok(Self::make_surface(handle.ns_view as id, handle.ns_window as id).unwrap()) Ok(Self::make_surface(handle.ns_view as id, handle.ns_window as id).unwrap())
} else { } else {
Err("can't create surface for window handle".into()) Err("can't create surface for window handle".into())

View file

@ -16,7 +16,7 @@
//! Utilities and types for Metal integration //! Utilities and types for Metal integration
use metal::{CGFloat, CGSize}; use core_graphics_types::{base::CGFloat, geometry::CGSize};
#[link(name = "QuartzCore", kind = "framework")] #[link(name = "QuartzCore", kind = "framework")]
extern "C" { extern "C" {

View file

@ -16,6 +16,8 @@
//! A multiplexer module that selects a back-end at runtime. //! A multiplexer module that selects a back-end at runtime.
use raw_window_handle::RawDisplayHandle;
use raw_window_handle::RawWindowHandle;
use smallvec::SmallVec; use smallvec::SmallVec;
mux_cfg! { mux_cfg! {
@ -163,12 +165,13 @@ impl Instance {
/// Create a surface from the specified window handle. /// Create a surface from the specified window handle.
pub unsafe fn surface( pub unsafe fn surface(
&self, &self,
window_handle: &dyn raw_window_handle::HasRawWindowHandle, display_handle: RawDisplayHandle,
window_handle: RawWindowHandle,
) -> Result<Surface, Error> { ) -> Result<Surface, Error> {
mux_match! { self; mux_match! { self;
Instance::Vk(i) => i.surface(window_handle).map(Surface::Vk), Instance::Vk(i) => i.surface(display_handle, window_handle).map(Surface::Vk),
Instance::Dx12(i) => i.surface(window_handle).map(Surface::Dx12), Instance::Dx12(i) => i.surface(display_handle, window_handle).map(Surface::Dx12),
Instance::Mtl(i) => i.surface(window_handle).map(Surface::Mtl), Instance::Mtl(i) => i.surface(display_handle, window_handle).map(Surface::Mtl),
} }
} }

View file

@ -10,6 +10,7 @@ use ash::extensions::{ext::DebugUtils, khr};
use ash::vk::DebugUtilsLabelEXT; use ash::vk::DebugUtilsLabelEXT;
use ash::{vk, Device, Entry, Instance}; use ash::{vk, Device, Entry, Instance};
use raw_window_handle::{RawDisplayHandle, RawWindowHandle};
use smallvec::SmallVec; use smallvec::SmallVec;
use crate::backend::Device as DeviceTrait; use crate::backend::Device as DeviceTrait;
@ -157,7 +158,7 @@ impl VkInstance {
pub fn new() -> Result<VkInstance, Error> { pub fn new() -> Result<VkInstance, Error> {
unsafe { unsafe {
let app_name = CString::new("VkToy").unwrap(); let app_name = CString::new("VkToy").unwrap();
let entry = Entry::new()?; let entry = Entry::load()?;
let mut layers = Layers::new(entry.enumerate_instance_layer_properties()?); let mut layers = Layers::new(entry.enumerate_instance_layer_properties()?);
if cfg!(debug_assertions) { if cfg!(debug_assertions) {
@ -165,7 +166,7 @@ impl VkInstance {
.try_add(CStr::from_bytes_with_nul(b"VK_LAYER_KHRONOS_validation\0").unwrap()); .try_add(CStr::from_bytes_with_nul(b"VK_LAYER_KHRONOS_validation\0").unwrap());
} }
let mut exts = Extensions::new(entry.enumerate_instance_extension_properties()?); let mut exts = Extensions::new(entry.enumerate_instance_extension_properties(None)?);
let mut has_debug_ext = false; let mut has_debug_ext = false;
if cfg!(debug_assertions) { if cfg!(debug_assertions) {
has_debug_ext = exts.try_add(DebugUtils::name()); has_debug_ext = exts.try_add(DebugUtils::name());
@ -221,12 +222,15 @@ impl VkInstance {
)?; )?;
let (dbg_loader, _dbg_callbk) = if has_debug_ext { let (dbg_loader, _dbg_callbk) = if has_debug_ext {
let flags = vk::DebugUtilsMessageTypeFlagsEXT::GENERAL
| vk::DebugUtilsMessageTypeFlagsEXT::PERFORMANCE
| vk::DebugUtilsMessageTypeFlagsEXT::VALIDATION;
let dbg_info = vk::DebugUtilsMessengerCreateInfoEXT::builder() let dbg_info = vk::DebugUtilsMessengerCreateInfoEXT::builder()
.message_severity( .message_severity(
vk::DebugUtilsMessageSeverityFlagsEXT::ERROR vk::DebugUtilsMessageSeverityFlagsEXT::ERROR
| vk::DebugUtilsMessageSeverityFlagsEXT::WARNING, | vk::DebugUtilsMessageSeverityFlagsEXT::WARNING,
) )
.message_type(vk::DebugUtilsMessageTypeFlagsEXT::all()) .message_type(flags)
.pfn_user_callback(Some(vulkan_debug_callback)); .pfn_user_callback(Some(vulkan_debug_callback));
let dbg_loader = DebugUtils::new(&entry, &instance); let dbg_loader = DebugUtils::new(&entry, &instance);
let dbg_callbk = dbg_loader let dbg_callbk = dbg_loader
@ -256,10 +260,17 @@ impl VkInstance {
/// The caller is responsible for making sure that the instance outlives the surface. /// The caller is responsible for making sure that the instance outlives the surface.
pub unsafe fn surface( pub unsafe fn surface(
&self, &self,
window_handle: &dyn raw_window_handle::HasRawWindowHandle, display_handle: RawDisplayHandle,
window_handle: RawWindowHandle,
) -> Result<VkSurface, Error> { ) -> Result<VkSurface, Error> {
Ok(VkSurface { Ok(VkSurface {
surface: ash_window::create_surface(&self.entry, &self.instance, window_handle, None)?, surface: ash_window::create_surface(
&self.entry,
&self.instance,
display_handle,
window_handle,
None,
)?,
surface_fn: khr::Surface::new(&self.entry, &self.instance), surface_fn: khr::Surface::new(&self.entry, &self.instance),
}) })
} }
@ -273,8 +284,7 @@ impl VkInstance {
/// but for now keep things simple. /// but for now keep things simple.
pub unsafe fn device(&self) -> Result<VkDevice, Error> { pub unsafe fn device(&self) -> Result<VkDevice, Error> {
let devices = self.instance.enumerate_physical_devices()?; let devices = self.instance.enumerate_physical_devices()?;
let (pdevice, qfi) = let (pdevice, qfi) = choose_device(&self.instance, &devices).ok_or("no suitable device")?;
choose_device(&self.instance, &devices).ok_or("no suitable device")?;
let mut has_descriptor_indexing = false; let mut has_descriptor_indexing = false;
let vk1_1 = self.vk_version >= vk::make_api_version(0, 1, 1, 0); let vk1_1 = self.vk_version >= vk::make_api_version(0, 1, 1, 0);
@ -1456,7 +1466,10 @@ unsafe fn choose_device(
// both Metal and DX12 which do not require such validation. It might be worth // both Metal and DX12 which do not require such validation. It might be worth
// exposing this to the user in a future device enumeration API, which would // exposing this to the user in a future device enumeration API, which would
// also allow selection between discrete and integrated devices. // also allow selection between discrete and integrated devices.
if info.queue_flags.contains(vk::QueueFlags::COMPUTE | vk::QueueFlags::GRAPHICS) { if info
.queue_flags
.contains(vk::QueueFlags::COMPUTE | vk::QueueFlags::GRAPHICS)
{
return Some((*pdevice, ix as u32)); return Some((*pdevice, ix as u32));
} }
} }

View file

@ -31,11 +31,12 @@ path = "../piet-scene"
features = ["kurbo"] features = ["kurbo"]
[dependencies] [dependencies]
png = "0.16.2" png = "0.17.6"
rand = "0.7.3" rand = "0.8.5"
roxmltree = "0.13" roxmltree = "0.13"
winit = "0.26.1" winit = {version = "0.27.3", default-features = false, features = ["x11", "wayland", "wayland-dlopen"]}
clap = "2.33" raw-window-handle = "0.5"
clap = "3.2.22"
bytemuck = { version = "1.7.2", features = ["derive"] } bytemuck = { version = "1.7.2", features = ["derive"] }
kurbo = "0.8.3" kurbo = "0.8.3"

View file

@ -6,10 +6,10 @@
//! Requires the [cargo-apk] tool. //! Requires the [cargo-apk] tool.
//! [cargo-apk]: https://crates.io/crates/cargo-apk //! [cargo-apk]: https://crates.io/crates/cargo-apk
use raw_window_handle::android::AndroidHandle; use raw_window_handle::{
use raw_window_handle::{HasRawWindowHandle, RawWindowHandle}; AndroidDisplayHandle, AndroidNdkWindowHandle, RawDisplayHandle, RawWindowHandle,
};
use ndk::native_window::NativeWindow;
use ndk_glue::Event; use ndk_glue::Event;
use piet_gpu_hal::{ use piet_gpu_hal::{
@ -25,10 +25,6 @@ fn main() {
my_main().unwrap(); my_main().unwrap();
} }
struct MyHandle {
handle: AndroidHandle,
}
// State required to render and present the contents // State required to render and present the contents
struct GfxState { struct GfxState {
session: Session, session: Session,
@ -51,9 +47,13 @@ fn my_main() -> Result<(), Error> {
if let Some(window) = &*window { if let Some(window) = &*window {
let width = window.width() as usize; let width = window.width() as usize;
let height = window.height() as usize; let height = window.height() as usize;
let handle = get_handle(window);
let instance = Instance::new(InstanceFlags::default())?; let instance = Instance::new(InstanceFlags::default())?;
let surface = unsafe { instance.surface(&handle)? }; let mut android_handle = AndroidNdkWindowHandle::empty();
android_handle.a_native_window = window.ptr().as_ptr() as *mut _;
let window_handle = RawWindowHandle::AndroidNdk(android_handle);
let display_handle =
RawDisplayHandle::Android(AndroidDisplayHandle::empty());
let surface = unsafe { instance.surface(display_handle, window_handle)? };
gfx_state = Some(GfxState::new(&instance, Some(&surface), width, height)?); gfx_state = Some(GfxState::new(&instance, Some(&surface), width, height)?);
} else { } else {
println!("native window is sadly none"); println!("native window is sadly none");
@ -72,24 +72,6 @@ fn my_main() -> Result<(), Error> {
} }
} }
fn get_handle(window: &NativeWindow) -> MyHandle {
println!(
"window = {:?}, {}x{}",
window.ptr(),
window.width(),
window.height()
);
let mut handle = AndroidHandle::empty();
handle.a_native_window = window.ptr().as_ptr() as *mut std::ffi::c_void;
MyHandle { handle }
}
unsafe impl HasRawWindowHandle for MyHandle {
fn raw_window_handle(&self) -> RawWindowHandle {
RawWindowHandle::Android(self.handle)
}
}
impl GfxState { impl GfxState {
fn new( fn new(
instance: &Instance, instance: &Instance,

View file

@ -219,10 +219,10 @@ fn trace_ptcl(buf: &[u32]) {
fn main() -> Result<(), Error> { fn main() -> Result<(), Error> {
let matches = App::new("piet-gpu test") let matches = App::new("piet-gpu test")
.arg(Arg::with_name("INPUT").index(1)) .arg(Arg::with_name("INPUT").index(1))
.arg(Arg::with_name("flip").short("f").long("flip")) .arg(Arg::with_name("flip").short('f').long("flip"))
.arg( .arg(
Arg::with_name("scale") Arg::with_name("scale")
.short("s") .short('s')
.long("scale") .long("scale")
.takes_value(true), .takes_value(true),
) )
@ -280,7 +280,7 @@ fn main() -> Result<(), Error> {
let ref mut w = BufWriter::new(file); let ref mut w = BufWriter::new(file);
let mut encoder = png::Encoder::new(w, WIDTH as u32, HEIGHT as u32); let mut encoder = png::Encoder::new(w, WIDTH as u32, HEIGHT as u32);
encoder.set_color(png::ColorType::RGBA); encoder.set_color(png::ColorType::Rgba);
encoder.set_depth(png::BitDepth::Eight); encoder.set_depth(png::BitDepth::Eight);
let mut writer = encoder.write_header().unwrap(); let mut writer = encoder.write_header().unwrap();

View file

@ -4,6 +4,8 @@ use piet_scene::{Scene, SceneBuilder};
use clap::{App, Arg}; use clap::{App, Arg};
use raw_window_handle::{HasRawDisplayHandle, HasRawWindowHandle};
use winit::{ use winit::{
event::{Event, WindowEvent}, event::{Event, WindowEvent},
event_loop::{ControlFlow, EventLoop}, event_loop::{ControlFlow, EventLoop},
@ -18,10 +20,10 @@ const HEIGHT: usize = 1536;
fn main() -> Result<(), Error> { fn main() -> Result<(), Error> {
let matches = App::new("piet-gpu test") let matches = App::new("piet-gpu test")
.arg(Arg::with_name("INPUT").index(1)) .arg(Arg::with_name("INPUT").index(1))
.arg(Arg::with_name("flip").short("f").long("flip")) .arg(Arg::with_name("flip").short('f').long("flip"))
.arg( .arg(
Arg::with_name("scale") Arg::with_name("scale")
.short("s") .short('s')
.long("scale") .long("scale")
.takes_value(true), .takes_value(true),
) )
@ -60,7 +62,9 @@ fn main() -> Result<(), Error> {
let mut scene = Scene::default(); let mut scene = Scene::default();
let mut simple_text = piet_gpu::SimpleText::new(); let mut simple_text = piet_gpu::SimpleText::new();
unsafe { unsafe {
let surface = instance.surface(&window)?; let display_handle = window.raw_display_handle();
let window_handle = window.raw_window_handle();
let surface = instance.surface(display_handle, window_handle)?;
let device = instance.device()?; let device = instance.device()?;
let mut swapchain = instance.swapchain(WIDTH / 2, HEIGHT / 2, &device, &surface)?; let mut swapchain = instance.swapchain(WIDTH / 2, HEIGHT / 2, &device, &surface)?;
let session = Session::new(device); let session = Session::new(device);