Upgraded to gfx_hal 0.6.0
+ added swapchain recreation mechanism + sorted minor issues ! some framebuffer error present ! may crash during swapchain recreation
This commit is contained in:
parent
6579566ccd
commit
5f9cc86689
242
Cargo.lock
generated
242
Cargo.lock
generated
@ -37,9 +37,9 @@ checksum = "cff77d8686867eceff3105329d4698d96c2391c176d5d03adc90c7389162b5b8"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "ash"
|
name = "ash"
|
||||||
version = "0.30.0"
|
version = "0.31.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "69daec0742947f33a85931fa3cb0ce5f07929159dcbd1f0cbb5b2912e2978509"
|
checksum = "c69a8137596e84c22d57f3da1b5de1d4230b1742a710091c85f4d7ce50f00f38"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"libloading",
|
"libloading",
|
||||||
]
|
]
|
||||||
@ -52,14 +52,14 @@ checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8"
|
|||||||
dependencies = [
|
dependencies = [
|
||||||
"hermit-abi",
|
"hermit-abi",
|
||||||
"libc",
|
"libc",
|
||||||
"winapi 0.3.8",
|
"winapi 0.3.9",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "autocfg"
|
name = "autocfg"
|
||||||
version = "1.0.0"
|
version = "1.0.1"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "f8aac770f1885fd7e387acedd76065302551364496e46b3dd00860b2f8359b9d"
|
checksum = "cdb031dd78e28731d87d56cc8ffef4a8f36ca26c38fe2de700543e627f8a464a"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "bitflags"
|
name = "bitflags"
|
||||||
@ -92,9 +92,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "cc"
|
name = "cc"
|
||||||
version = "1.0.50"
|
version = "1.0.59"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "95e28fa049fda1c330bcf9d723be7663a899c4679724b34c81e9f5a326aab8cd"
|
checksum = "66120af515773fb005778dc07c261bd201ec8ce50bd6e7144c927753fe013381"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "cfg-if"
|
name = "cfg-if"
|
||||||
@ -104,9 +104,9 @@ checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "chrono"
|
name = "chrono"
|
||||||
version = "0.4.11"
|
version = "0.4.15"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "80094f509cf8b5ae86a4966a39b3ff66cd7e2a3e594accec3743ff3fabeab5b2"
|
checksum = "942f72db697d8767c22d46a598e01f2d3b475501ea43d0db4f16d90259182d0b"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"num-integer",
|
"num-integer",
|
||||||
"num-traits",
|
"num-traits",
|
||||||
@ -124,13 +124,13 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "cocoa"
|
name = "cocoa"
|
||||||
version = "0.20.1"
|
version = "0.20.2"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "8f7b6f3f7f4f0b3ec5c5039aaa9e8c3cef97a7a480a400fd62944841314f293d"
|
checksum = "0c49e86fc36d5704151f5996b7b3795385f50ce09e3be0f47a0cfde869681cf8"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bitflags",
|
"bitflags",
|
||||||
"block",
|
"block",
|
||||||
"core-foundation",
|
"core-foundation 0.7.0",
|
||||||
"core-graphics",
|
"core-graphics",
|
||||||
"foreign-types",
|
"foreign-types",
|
||||||
"libc",
|
"libc",
|
||||||
@ -145,7 +145,7 @@ checksum = "f4ffc801dacf156c5854b9df4f425a626539c3a6ef7893cc0c5084a23f0b6c59"
|
|||||||
dependencies = [
|
dependencies = [
|
||||||
"atty",
|
"atty",
|
||||||
"lazy_static",
|
"lazy_static",
|
||||||
"winapi 0.3.8",
|
"winapi 0.3.9",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@ -154,7 +154,17 @@ 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 = "57d24c7a13c43e870e37c1556b74555437870a04514f7685f5b354e090567171"
|
checksum = "57d24c7a13c43e870e37c1556b74555437870a04514f7685f5b354e090567171"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"core-foundation-sys",
|
"core-foundation-sys 0.7.0",
|
||||||
|
"libc",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "core-foundation"
|
||||||
|
version = "0.9.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "3b5ed8e7e76c45974e15e41bfa8d5b0483cd90191639e01d8f5f1e606299d3fb"
|
||||||
|
dependencies = [
|
||||||
|
"core-foundation-sys 0.8.0",
|
||||||
"libc",
|
"libc",
|
||||||
]
|
]
|
||||||
|
|
||||||
@ -165,13 +175,31 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||||||
checksum = "b3a71ab494c0b5b860bdc8407ae08978052417070c2ced38573a9157ad75b8ac"
|
checksum = "b3a71ab494c0b5b860bdc8407ae08978052417070c2ced38573a9157ad75b8ac"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "core-graphics"
|
name = "core-foundation-sys"
|
||||||
version = "0.19.0"
|
version = "0.8.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "59e78b2e0aaf43f08e7ae0d6bc96895ef72ff0921c7d4ff4762201b2dba376dd"
|
checksum = "9a21fa21941700a3cd8fcb4091f361a6a712fac632f85d9f487cc892045d55c6"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "core-graphics"
|
||||||
|
version = "0.19.2"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "b3889374e6ea6ab25dba90bb5d96202f61108058361f6dc72e8b03e6f8bbe923"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bitflags",
|
"bitflags",
|
||||||
"core-foundation",
|
"core-foundation 0.7.0",
|
||||||
|
"foreign-types",
|
||||||
|
"libc",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "core-graphics-types"
|
||||||
|
version = "0.1.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "e92f5d519093a4178296707dbaa3880eae85a5ef5386675f361a1cf25376e93c"
|
||||||
|
dependencies = [
|
||||||
|
"bitflags",
|
||||||
|
"core-foundation 0.9.0",
|
||||||
"foreign-types",
|
"foreign-types",
|
||||||
"libc",
|
"libc",
|
||||||
]
|
]
|
||||||
@ -183,7 +211,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||||||
checksum = "34ecad23610ad9757664d644e369246edde1803fcb43ed72876565098a5d3828"
|
checksum = "34ecad23610ad9757664d644e369246edde1803fcb43ed72876565098a5d3828"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"cfg-if",
|
"cfg-if",
|
||||||
"core-foundation-sys",
|
"core-foundation-sys 0.7.0",
|
||||||
"core-graphics",
|
"core-graphics",
|
||||||
"libc",
|
"libc",
|
||||||
"objc",
|
"objc",
|
||||||
@ -195,7 +223,7 @@ version = "2.1.1"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "cb582b60359da160a9477ee80f15c8d784c477e69c217ef2cdd4169c24ea380f"
|
checksum = "cb582b60359da160a9477ee80f15c8d784c477e69c217ef2cdd4169c24ea380f"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"proc-macro2 1.0.18",
|
"proc-macro2 1.0.20",
|
||||||
"quote 1.0.7",
|
"quote 1.0.7",
|
||||||
"syn",
|
"syn",
|
||||||
]
|
]
|
||||||
@ -208,18 +236,18 @@ checksum = "bd0c93bb4b0c6d9b77f4435b0ae98c24d17f1c45b2ff844c6151a07256ca923b"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "dlib"
|
name = "dlib"
|
||||||
version = "0.4.1"
|
version = "0.4.2"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "77e51249a9d823a4cb79e3eca6dcd756153e8ed0157b6c04775d04bf1b13b76a"
|
checksum = "b11f15d1e3268f140f68d390637d5e76d849782d971ae7063e0da69fe9709a76"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"libloading",
|
"libloading",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "downcast-rs"
|
name = "downcast-rs"
|
||||||
version = "1.1.1"
|
version = "1.2.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "52ba6eb47c2131e784a38b726eb54c1e1484904f013e576a25354d0124161af6"
|
checksum = "9ea835d29036a4087793836fa931b08837ad5e957da9e23886b29586fb9b6650"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "fern"
|
name = "fern"
|
||||||
@ -264,29 +292,30 @@ checksum = "3dcaa9ae7725d12cdb85b3ad99a434db70b468c09ded17e012d86b5c1010f7a7"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "gfx-backend-vulkan"
|
name = "gfx-backend-vulkan"
|
||||||
version = "0.5.2"
|
version = "0.6.1"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "ebd1dee09bd8d8f1ba52c5ba22d1f70c7ffa990c5eb245eb3ef2d0206f631673"
|
checksum = "a84bda4200a82e1912d575801e2bb76ae19c6256359afbc0adfbbaec02fcadc6"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"arrayvec",
|
"arrayvec",
|
||||||
"ash",
|
"ash",
|
||||||
"byteorder",
|
"byteorder",
|
||||||
"core-graphics",
|
"core-graphics-types",
|
||||||
"gfx-hal",
|
"gfx-hal",
|
||||||
|
"inplace_it",
|
||||||
"lazy_static",
|
"lazy_static",
|
||||||
"log",
|
"log",
|
||||||
"objc",
|
"objc",
|
||||||
"raw-window-handle",
|
"raw-window-handle",
|
||||||
"smallvec",
|
"smallvec",
|
||||||
"winapi 0.3.8",
|
"winapi 0.3.9",
|
||||||
"x11",
|
"x11",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "gfx-hal"
|
name = "gfx-hal"
|
||||||
version = "0.5.3"
|
version = "0.6.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "a18534b23d4c262916231511309bc1f307c74cda8dcb68b93a10ca213a22814b"
|
checksum = "18d0754f5b7a43915fd7466883b2d1bb0800d7cc4609178d0b27bf143b9e5123"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bitflags",
|
"bitflags",
|
||||||
"raw-window-handle",
|
"raw-window-handle",
|
||||||
@ -294,18 +323,24 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "hermit-abi"
|
name = "hermit-abi"
|
||||||
version = "0.1.14"
|
version = "0.1.15"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "b9586eedd4ce6b3c498bc3b4dd92fc9f11166aa908a914071953768066c67909"
|
checksum = "3deed196b6e7f9e44a2ae8d94225d80302d81208b1bb673fd21fe634645c85a9"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"libc",
|
"libc",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "instant"
|
name = "inplace_it"
|
||||||
version = "0.1.2"
|
version = "0.3.2"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "6c346c299e3fe8ef94dc10c2c0253d858a69aac1245157a3bf4125915d528caf"
|
checksum = "dd01a2a73f2f399df96b22dc88ea687ef4d76226284e7531ae3c7ee1dc5cb534"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "instant"
|
||||||
|
version = "0.1.6"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "5b141fdc7836c525d4d594027d318c84161ca17aaf8113ab1f81ab93ae897485"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "iovec"
|
name = "iovec"
|
||||||
@ -354,24 +389,24 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "lazycell"
|
name = "lazycell"
|
||||||
version = "1.2.1"
|
version = "1.3.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "b294d6fa9ee409a054354afc4352b0b9ef7ca222c69b8812cbea9e7d2bf3783f"
|
checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "libc"
|
name = "libc"
|
||||||
version = "0.2.68"
|
version = "0.2.76"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "dea0c0405123bba743ee3f91f49b1c7cfb684eef0da0a50110f758ccf24cdff0"
|
checksum = "755456fae044e6fa1ebbbd1b3e902ae19e73097ed4ed87bb79934a867c007bc3"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "libloading"
|
name = "libloading"
|
||||||
version = "0.5.2"
|
version = "0.6.3"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "f2b111a074963af1d37a139918ac6d49ad1d0d5e47f72fd55388619691a7d753"
|
checksum = "2443d8f0478b16759158b2f66d525991a05491138bc05814ef52a250148ef4f9"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"cc",
|
"cfg-if",
|
||||||
"winapi 0.3.8",
|
"winapi 0.3.9",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@ -385,18 +420,18 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "lock_api"
|
name = "lock_api"
|
||||||
version = "0.3.3"
|
version = "0.3.4"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "79b2de95ecb4691949fea4716ca53cdbcfccb2c612e19644a8bad05edcf9f47b"
|
checksum = "c4da24a77a3d8a6d4862d95f72e6fdb9c09a643ecdb402d754004a557f2bec75"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"scopeguard",
|
"scopeguard",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "log"
|
name = "log"
|
||||||
version = "0.4.8"
|
version = "0.4.11"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "14b6052be84e6b71ab17edffc2eeabf5c2c3ae1fdb464aae35ac50c67a44e1f7"
|
checksum = "4fabed175da42fed1fa0746b0ea71f412aa9d35e76e95e59b192c64b9dc2bf8b"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"cfg-if",
|
"cfg-if",
|
||||||
]
|
]
|
||||||
@ -423,14 +458,14 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||||||
checksum = "6585fd95e7bb50d6cc31e20d4cf9afb4e2ba16c5846fc76793f11218da9c475b"
|
checksum = "6585fd95e7bb50d6cc31e20d4cf9afb4e2ba16c5846fc76793f11218da9c475b"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"libc",
|
"libc",
|
||||||
"winapi 0.3.8",
|
"winapi 0.3.9",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "mio"
|
name = "mio"
|
||||||
version = "0.6.21"
|
version = "0.6.22"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "302dec22bcf6bae6dfb69c647187f4b4d0fb6f535521f7bc022430ce8e12008f"
|
checksum = "fce347092656428bc8eaf6201042cb551b8d67855af7374542a92a0fbfcac430"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"cfg-if",
|
"cfg-if",
|
||||||
"fuchsia-zircon",
|
"fuchsia-zircon",
|
||||||
@ -502,13 +537,13 @@ checksum = "2b2820aca934aba5ed91c79acc72b6a44048ceacc5d36c035ed4e051f12d887d"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "net2"
|
name = "net2"
|
||||||
version = "0.2.33"
|
version = "0.2.34"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "42550d9fb7b6684a6d404d9fa7250c2eb2646df731d1c06afc06dcee9e1bcf88"
|
checksum = "2ba7c918ac76704fb42afcbbb43891e72731f3dcca3bef2a19786297baf14af7"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"cfg-if",
|
"cfg-if",
|
||||||
"libc",
|
"libc",
|
||||||
"winapi 0.3.8",
|
"winapi 0.3.9",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@ -526,9 +561,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "num-integer"
|
name = "num-integer"
|
||||||
version = "0.1.42"
|
version = "0.1.43"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "3f6ea62e9d81a77cd3ee9a2a5b9b609447857f3d358704331e4ef39eb247fcba"
|
checksum = "8d59457e662d541ba17869cf51cf177c0b5f0cbf476c66bdc90bf1edac4f875b"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"autocfg",
|
"autocfg",
|
||||||
"num-traits",
|
"num-traits",
|
||||||
@ -560,7 +595,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||||||
checksum = "ffa5a33ddddfee04c0283a7653987d634e880347e96b5b2ed64de07efb59db9d"
|
checksum = "ffa5a33ddddfee04c0283a7653987d634e880347e96b5b2ed64de07efb59db9d"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"proc-macro-crate",
|
"proc-macro-crate",
|
||||||
"proc-macro2 1.0.18",
|
"proc-macro2 1.0.20",
|
||||||
"quote 1.0.7",
|
"quote 1.0.7",
|
||||||
"syn",
|
"syn",
|
||||||
]
|
]
|
||||||
@ -576,18 +611,18 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "ordered-float"
|
name = "ordered-float"
|
||||||
version = "1.0.2"
|
version = "1.1.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "18869315e81473c951eb56ad5558bbc56978562d3ecfb87abb7a1e944cea4518"
|
checksum = "3741934be594d77de1c8461ebcbbe866f585ea616a9753aa78f2bdc69f0e4579"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"num-traits",
|
"num-traits",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "parking_lot"
|
name = "parking_lot"
|
||||||
version = "0.10.0"
|
version = "0.10.2"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "92e98c49ab0b7ce5b222f2cc9193fc4efe11c6d0bd4f648e374684a6857b1cfc"
|
checksum = "d3a704eb390aafdc107b0e392f56a82b668e3a71366993b5340f5833fd62505e"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"lock_api",
|
"lock_api",
|
||||||
"parking_lot_core",
|
"parking_lot_core",
|
||||||
@ -595,16 +630,16 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "parking_lot_core"
|
name = "parking_lot_core"
|
||||||
version = "0.7.0"
|
version = "0.7.2"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "7582838484df45743c8434fbff785e8edf260c28748353d44bc0da32e0ceabf1"
|
checksum = "d58c7c768d4ba344e3e8d72518ac13e259d7c7ade24167003b8488e10b6740a3"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"cfg-if",
|
"cfg-if",
|
||||||
"cloudabi",
|
"cloudabi",
|
||||||
"libc",
|
"libc",
|
||||||
"redox_syscall",
|
"redox_syscall",
|
||||||
"smallvec",
|
"smallvec",
|
||||||
"winapi 0.3.8",
|
"winapi 0.3.9",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@ -615,15 +650,15 @@ checksum = "d4fd5641d01c8f18a23da7b6fe29298ff4b55afcccdf78973b24cf3175fee32e"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "pkg-config"
|
name = "pkg-config"
|
||||||
version = "0.3.17"
|
version = "0.3.18"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "05da548ad6865900e60eaba7f589cc0783590a92e940c26953ff81ddbab2d677"
|
checksum = "d36492546b6af1463394d46f0c834346f31548646f6ba10849802c9c9a27ac33"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "proc-macro-crate"
|
name = "proc-macro-crate"
|
||||||
version = "0.1.4"
|
version = "0.1.5"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "e10d4b51f154c8a7fb96fd6dad097cb74b863943ec010ac94b9fd1be8861fe1e"
|
checksum = "1d6ea3c4595b96363c13943497db34af4460fb474a95c43f4446ad341b8c9785"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"toml",
|
"toml",
|
||||||
]
|
]
|
||||||
@ -639,11 +674,11 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "proc-macro2"
|
name = "proc-macro2"
|
||||||
version = "1.0.18"
|
version = "1.0.20"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "beae6331a816b1f65d04c45b078fd8e6c93e8071771f41b8163255bbd8d7c8fa"
|
checksum = "175c513d55719db99da20232b06cda8bab6b83ec2d04e3283edf0213c37c1a29"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"unicode-xid 0.2.0",
|
"unicode-xid 0.2.1",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@ -661,7 +696,7 @@ version = "1.0.7"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "aa563d17ecb180e500da1cfd2b028310ac758de548efdd203e18f283af693f37"
|
checksum = "aa563d17ecb180e500da1cfd2b028310ac758de548efdd203e18f283af693f37"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"proc-macro2 1.0.18",
|
"proc-macro2 1.0.20",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@ -675,9 +710,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "redox_syscall"
|
name = "redox_syscall"
|
||||||
version = "0.1.56"
|
version = "0.1.57"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "2439c63f3f6139d1b57529d16bc3b8bb855230c8efcc5d3a896c8bea7c3b1e84"
|
checksum = "41cc0f7e4d5d4544e8861606a285bb08d3e70712ccc7d2b84d7c0ccfaf4b05ce"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "rusttype"
|
name = "rusttype"
|
||||||
@ -685,17 +720,16 @@ version = "0.7.9"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "310942406a39981bed7e12b09182a221a29e0990f3e7e0c971f131922ed135d5"
|
checksum = "310942406a39981bed7e12b09182a221a29e0990f3e7e0c971f131922ed135d5"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"rusttype 0.8.2",
|
"rusttype 0.8.3",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "rusttype"
|
name = "rusttype"
|
||||||
version = "0.8.2"
|
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 = "14a911032fb5791ccbeec9f28fdcb9bf0983b81f227bafdfd227c658d0731c8a"
|
checksum = "9f61411055101f7b60ecf1041d87fb74205fb20b0c7a723f07ef39174cf6b4c0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"approx",
|
"approx",
|
||||||
"arrayvec",
|
|
||||||
"ordered-float",
|
"ordered-float",
|
||||||
"stb_truetype",
|
"stb_truetype",
|
||||||
]
|
]
|
||||||
@ -717,9 +751,9 @@ checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "serde"
|
name = "serde"
|
||||||
version = "1.0.112"
|
version = "1.0.115"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "736aac72d1eafe8e5962d1d1c3d99b0df526015ba40915cb3c49d042e92ec243"
|
checksum = "e54c9a88f2da7238af84b5101443f0c0d0a3bbdc455e34a5c9497b1903ed55d5"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "slab"
|
name = "slab"
|
||||||
@ -729,9 +763,9 @@ checksum = "c111b5bd5695e56cffe5129854aa230b39c93a305372fdbb2668ca2394eea9f8"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "smallvec"
|
name = "smallvec"
|
||||||
version = "1.2.0"
|
version = "1.4.2"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "5c2fb2ec9bcd216a5b0d0ccf31ab17b5ed1d627960edff65bbe95d3ce221cefc"
|
checksum = "fbee7696b84bbf3d89a1c2eccff0850e3047ed46bfcd2e92c29a2d074d57e252"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "smithay-client-toolkit"
|
name = "smithay-client-toolkit"
|
||||||
@ -760,24 +794,24 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "syn"
|
name = "syn"
|
||||||
version = "1.0.31"
|
version = "1.0.40"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "b5304cfdf27365b7585c25d4af91b35016ed21ef88f17ced89c7093b43dba8b6"
|
checksum = "963f7d3cc59b59b9325165add223142bbf1df27655d07789f109896d353d8350"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"proc-macro2 1.0.18",
|
"proc-macro2 1.0.20",
|
||||||
"quote 1.0.7",
|
"quote 1.0.7",
|
||||||
"unicode-xid 0.2.0",
|
"unicode-xid 0.2.1",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "time"
|
name = "time"
|
||||||
version = "0.1.42"
|
version = "0.1.44"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "db8dcfca086c1143c9270ac42a2bbd8a7ee477b78ac8e45b19abfb0cbede4b6f"
|
checksum = "6db9e6914ab8b1ae1c260a4ae7a49b6c5611b40328a735b21862567685e73255"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"libc",
|
"libc",
|
||||||
"redox_syscall",
|
"wasi",
|
||||||
"winapi 0.3.8",
|
"winapi 0.3.9",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@ -797,9 +831,9 @@ checksum = "fc72304796d0818e357ead4e000d19c9c174ab23dc11093ac919054d20a6a7fc"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "unicode-xid"
|
name = "unicode-xid"
|
||||||
version = "0.2.0"
|
version = "0.2.1"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "826e7639553986605ec5979c7dd957c7895e93eabed50ab2ffa7f6128a75097c"
|
checksum = "f7fe0bb3479651439c9112f72b6c505038574c9fbb575ed1bf3b797fa39dd564"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "void"
|
name = "void"
|
||||||
@ -814,10 +848,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||||||
checksum = "777182bc735b6424e1a57516d35ed72cb8019d85c8c9bf536dccb3445c1a2f7d"
|
checksum = "777182bc735b6424e1a57516d35ed72cb8019d85c8c9bf536dccb3445c1a2f7d"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"same-file",
|
"same-file",
|
||||||
"winapi 0.3.8",
|
"winapi 0.3.9",
|
||||||
"winapi-util",
|
"winapi-util",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "wasi"
|
||||||
|
version = "0.10.0+wasi-snapshot-preview1"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "1a143597ca7c7793eff794def352d41792a93c481eb1042423ff7ff72ba2c31f"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "wayland-client"
|
name = "wayland-client"
|
||||||
version = "0.23.6"
|
version = "0.23.6"
|
||||||
@ -886,9 +926,9 @@ checksum = "167dc9d6949a9b857f3451275e911c3f44255842c1f7a76f33c55103a909087a"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "winapi"
|
name = "winapi"
|
||||||
version = "0.3.8"
|
version = "0.3.9"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "8093091eeb260906a183e6ae1abdba2ef5ef2257a21801128899c3fc699229c6"
|
checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"winapi-i686-pc-windows-gnu",
|
"winapi-i686-pc-windows-gnu",
|
||||||
"winapi-x86_64-pc-windows-gnu",
|
"winapi-x86_64-pc-windows-gnu",
|
||||||
@ -908,11 +948,11 @@ checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "winapi-util"
|
name = "winapi-util"
|
||||||
version = "0.1.4"
|
version = "0.1.5"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "fa515c5163a99cc82bab70fd3bfdd36d827be85de63737b40fcef2ce084a436e"
|
checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"winapi 0.3.8",
|
"winapi 0.3.9",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@ -929,7 +969,7 @@ checksum = "1e4ccbf7ddb6627828eace16cacde80fc6bf4dbb3469f88487262a02cf8e7862"
|
|||||||
dependencies = [
|
dependencies = [
|
||||||
"bitflags",
|
"bitflags",
|
||||||
"cocoa",
|
"cocoa",
|
||||||
"core-foundation",
|
"core-foundation 0.7.0",
|
||||||
"core-graphics",
|
"core-graphics",
|
||||||
"core-video-sys",
|
"core-video-sys",
|
||||||
"dispatch",
|
"dispatch",
|
||||||
@ -948,7 +988,7 @@ dependencies = [
|
|||||||
"raw-window-handle",
|
"raw-window-handle",
|
||||||
"smithay-client-toolkit",
|
"smithay-client-toolkit",
|
||||||
"wayland-client",
|
"wayland-client",
|
||||||
"winapi 0.3.8",
|
"winapi 0.3.9",
|
||||||
"x11-dl",
|
"x11-dl",
|
||||||
]
|
]
|
||||||
|
|
||||||
@ -992,6 +1032,6 @@ checksum = "d089681aa106a86fade1b0128fb5daf07d5867a509ab036d99988dec80429a57"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "xml-rs"
|
name = "xml-rs"
|
||||||
version = "0.8.2"
|
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 = "2bb76e5c421bbbeb8924c60c030331b345555024d56261dae8f3e786ed817c23"
|
checksum = "b07db065a5cf61a7e4ba64f29e67db906fb1787316516c4e6e5ff0fea1efcd8a"
|
||||||
|
|||||||
16
Cargo.toml
16
Cargo.toml
@ -7,16 +7,16 @@ edition = "2018"
|
|||||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
log = "0.4.8"
|
log = "^0.4.8"
|
||||||
chrono = "0.4.11"
|
chrono = "^0.4.11"
|
||||||
fern = { version = "0.6.0", features = ["colored"] }
|
fern = { version = "^0.6.0", features = ["colored"] }
|
||||||
gfx-hal = "0.5.3"
|
gfx-hal = "^0.6.0"
|
||||||
winit = "0.22.0"
|
winit = "^0.22.0"
|
||||||
raw-window-handle = "0.3.3"
|
raw-window-handle = "^0.3.3"
|
||||||
num-traits = "0.2.12"
|
num-traits = "^0.2.12"
|
||||||
|
|
||||||
[dependencies.gfx-backend-vulkan]
|
[dependencies.gfx-backend-vulkan]
|
||||||
version = "0.5"
|
version = "^0.6.1"
|
||||||
features = ["x11"]
|
features = ["x11"]
|
||||||
|
|
||||||
[lib]
|
[lib]
|
||||||
|
|||||||
@ -1 +1 @@
|
|||||||
<mxfile host="Electron" modified="2020-09-04T11:01:21.930Z" agent="Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) draw.io/12.5.3 Chrome/83.0.4103.122 Electron/9.2.1 Safari/537.36" etag="YgdyJS5-mkG3ly8C_Hns" version="12.5.3" type="device"><diagram id="nEmVVCywiwsQaQufvWWo" name="Page-1">7Vxtc+I4Ev41VM1dFRR+I/hjAmFmb5Pd7JC7yewXSrEFaMa2vLYIYX79SrbkNwnHBDuzufJUisHtVkvubrUedcsMjJn//DEC4fYWu9Ab6GP3eWDMB7quWxcX9D9GOaSUqTZOCZsIuSlJywlL9ANyomDbIRfGJUaCsUdQWCY6OAigQ0o0EEV4X2ZbY6/cawg2UCIsHeDJ1C/IJVtO1SZ2fuMTRJst73qq8wf2gWDmTxJvgYv3B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fa8h1/3TVDk78tFjgXawgD0pY4HGR+W1SVdQwJCPAyRnirJ8JZ/0eQKzn/p1Uz+bR61XTQRf+y4gF3Z7ZNCaeS29mXk7QwbyJk9dNPmCAvbuVuHlFUV+vO7IulgtmuEKwd+0PuFGYH80wZ93fnTMrylYZP06HgTROb2nt5KJctZASIRAsPHOGsU9l/GagfTBv93o0BgAdJYL4Dnod1zwsAb15Y4EP16y92RzT0xoC8RUxVu4gsPxQBwjJyVyFq0OAL5YIBEYq1ggqXtvsb36yFmeYaorARvFy7PvJSksnL2NpPDEFEu7yN3z8taZWWGrLFSrwL7u0sFib1kuB2jvuQjQpr0vLMuumOY8e4sl4K3sa9h9pP8Jkb62Zv5PCfXql6DYucxVnByceb+lX+H2bcSA6UQ3Wo0BWZVoUhFbKQN0GPUVL/wU9oC90UdTS5Rkz7TyRcnGF29m4Xd/pOn/J+6LNM8/Je6rs78hr/m836AvfL6doG+Xo7PZSjSobB7e7NSPqUj3vv+A36bBbc2urPLt7OzET4aU3ahViy9uHmxn8vBl+GN7HYx/+xHbt5riB7DSd3Aqpu7LekWznlDWyzJ2oqJjylm9rIJX+t2hFpL+SosrdvJJDpkPiOV8kaFLKWYxtux+n+4lDebVOaU+pV8YZkd+0f8eVXfGVaTylcbtas7LUE4Uffo4306cnzaI84bK5HYLxRulzVW13X4+106Pc4K10rhdzWfVu6xXSaNq5VcUuFW/WqZa5tn8OUUGf2M7KQ6n8tQV6n1ygiCXfFRsJswPmRo+gfgz2KfnDz6BgPlY/4pdN04tkMVLTm21cNjodhs9DB2IgsPtUgP3/7X3zzeKvcg9M+nbbjtZtipOV6Q876PYOUrLxfG1YaKVi0O2YUiaNhWK1k9fGuhl/ovK6R4x/11q4/pv</diagram></mxfile>
|
<mxfile host="Electron" modified="2020-09-06T15:26:10.830Z" agent="Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) draw.io/12.5.3 Chrome/83.0.4103.122 Electron/9.2.1 Safari/537.36" etag="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vXpM9QHfoIgq7m22rSyIGLD8A4kn8FBnD94B0LmY8MrcP04tWIWTzm1/fzDRvQy+71dsXXJfrXYuvob</diagram></mxfile>
|
||||||
14
src/lib.rs
14
src/lib.rs
@ -59,7 +59,7 @@ pub fn run() -> Result<(), &'static str> {
|
|||||||
|
|
||||||
let mut windows = vec![
|
let mut windows = vec![
|
||||||
WinitWindow::new("IV", Rect {w: 1280, h: 720})?,
|
WinitWindow::new("IV", Rect {w: 1280, h: 720})?,
|
||||||
WinitWindow::new("IV 2", Rect {w: 720, h: 480})?,
|
// WinitWindow::new("IV 2", Rect {w: 720, h: 480})?,
|
||||||
];
|
];
|
||||||
|
|
||||||
let mut renderer: Renderer<vk_back::Backend> = Renderer::new(&mut windows)?;
|
let mut renderer: Renderer<vk_back::Backend> = Renderer::new(&mut windows)?;
|
||||||
@ -67,18 +67,14 @@ pub fn run() -> Result<(), &'static str> {
|
|||||||
|
|
||||||
let color = [0.5, 0.0, 0.0, 1.0];
|
let color = [0.5, 0.0, 0.0, 1.0];
|
||||||
|
|
||||||
for window in &mut windows {
|
|
||||||
let _ = renderer.draw_clear_frame(window, color);
|
|
||||||
}
|
|
||||||
|
|
||||||
loop {
|
loop {
|
||||||
for window in &mut windows {
|
for window in &mut windows {
|
||||||
match renderer.draw_frame(window) {
|
match renderer.draw_clear_frame(window, color) {
|
||||||
Err(err) => println!("{}", err),
|
Err(err) => println!("{}", err),
|
||||||
_ => (),
|
_ => (),
|
||||||
}
|
}}}
|
||||||
}
|
|
||||||
}
|
// Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
// let (input_tx, input_rx) = mpsc::channel();
|
// let (input_tx, input_rx) = mpsc::channel();
|
||||||
|
|||||||
121
src/renderer.rs
121
src/renderer.rs
@ -3,6 +3,7 @@ use log::{debug, error, info, trace, warn};
|
|||||||
|
|
||||||
use std::{
|
use std::{
|
||||||
mem::ManuallyDrop,
|
mem::ManuallyDrop,
|
||||||
|
iter,
|
||||||
};
|
};
|
||||||
|
|
||||||
mod gpu;
|
mod gpu;
|
||||||
@ -31,7 +32,10 @@ where
|
|||||||
B: gfx_hal::Backend,
|
B: gfx_hal::Backend,
|
||||||
{
|
{
|
||||||
fn drop(&mut self) {
|
fn drop(&mut self) {
|
||||||
use gfx_hal::device::Device;
|
use gfx_hal::{
|
||||||
|
Instance,
|
||||||
|
device::Device,
|
||||||
|
};
|
||||||
|
|
||||||
debug!("Waiting for device to idle...");
|
debug!("Waiting for device to idle...");
|
||||||
let _ = self.gpu
|
let _ = self.gpu
|
||||||
@ -39,13 +43,14 @@ where
|
|||||||
.wait_idle();
|
.wait_idle();
|
||||||
|
|
||||||
info!("Dropping Renderer...");
|
info!("Dropping Renderer...");
|
||||||
for mut swap_system in self.swap_systems.drain(..) {
|
|
||||||
swap_system.drop(&mut self.gpu, &self.instance);
|
|
||||||
}
|
|
||||||
// for mut pipeline in self.pipelines.drain(..) {
|
// for mut pipeline in self.pipelines.drain(..) {
|
||||||
//
|
|
||||||
// }
|
// }
|
||||||
|
//
|
||||||
unsafe {
|
unsafe {
|
||||||
|
for mut swap_system in self.swap_systems.drain(..) {
|
||||||
|
self.instance.destroy_surface(swap_system.drop(&mut self.gpu));
|
||||||
|
}
|
||||||
ManuallyDrop::drop(&mut self.gpu);
|
ManuallyDrop::drop(&mut self.gpu);
|
||||||
ManuallyDrop::drop(&mut self.instance);
|
ManuallyDrop::drop(&mut self.instance);
|
||||||
}
|
}
|
||||||
@ -86,42 +91,88 @@ where
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn draw_frame<T, O>(&mut self, output: &mut O)
|
|
||||||
-> Result<(), &'static str>
|
|
||||||
where
|
|
||||||
T: raw_window_handle::HasRawWindowHandle,
|
|
||||||
O: Output<T>
|
|
||||||
{
|
|
||||||
use gfx_hal::window::AcquireError;
|
|
||||||
|
|
||||||
let swap_index = output.get_id();
|
|
||||||
let (frame, image_id) = match self.swap_systems[swap_index].acquire_frame() {
|
|
||||||
Ok((frame, image_id)) => (frame, image_id),
|
|
||||||
Err(err) => match err {
|
|
||||||
AcquireError::NotReady => {
|
|
||||||
return Err("Frame acquisition failed because all Frames are in use");
|
|
||||||
},
|
|
||||||
_ => Err("Could not acquire Frame from SwapSystem")?,
|
|
||||||
}};
|
|
||||||
|
|
||||||
let _ = frame.sync_gpu(&self.gpu)?;
|
|
||||||
|
|
||||||
let queue = &mut self.gpu.queue_mut();
|
|
||||||
frame.submit(queue);
|
|
||||||
|
|
||||||
let _ = self.swap_systems[swap_index].present_frame(frame, image_id, queue)?;
|
|
||||||
|
|
||||||
Ok(())
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn draw_clear_frame<T, O>(&mut self, output: &mut O, color: [f32; 4])
|
pub fn draw_clear_frame<T, O>(&mut self, output: &mut O, color: [f32; 4])
|
||||||
-> Result<(), &'static str>
|
-> Result<(), &'static str>
|
||||||
where
|
where
|
||||||
T: raw_window_handle::HasRawWindowHandle,
|
T: raw_window_handle::HasRawWindowHandle,
|
||||||
O: Output<T>
|
O: Output<T>
|
||||||
{
|
{
|
||||||
self.swap_systems[output.get_id()].configure_render_pass(color)?;
|
use gfx_hal::{
|
||||||
self.draw_frame(output)
|
window::AcquireError,
|
||||||
|
device::Device,
|
||||||
|
queue::Submission,
|
||||||
|
};
|
||||||
|
|
||||||
|
let swap_system = &mut self.swap_systems[output.get_id()];
|
||||||
|
|
||||||
|
let mut frame = match swap_system.acquire_frame(&self.gpu) {
|
||||||
|
Ok(frame) => frame,
|
||||||
|
Err(err) => match err {
|
||||||
|
AcquireError::NotReady => {
|
||||||
|
return Err("Frame acquisition failed because all Frames are in use");
|
||||||
|
},
|
||||||
|
AcquireError::OutOfDate => {
|
||||||
|
swap_system.recreate(&mut self.gpu)?;
|
||||||
|
debug!("SwapSystem : {:#?}", swap_system);
|
||||||
|
return Ok(());
|
||||||
|
},
|
||||||
|
_ => Err("Could not acquire Frame from SwapSystem")?,
|
||||||
|
}};
|
||||||
|
|
||||||
|
trace!("Waiting for Frame...");
|
||||||
|
unsafe {
|
||||||
|
let _ = self.gpu.device()
|
||||||
|
.wait_for_fence(&frame.fences[0], !0)
|
||||||
|
.map_err(|_| "Failed to wait for Fence")?;
|
||||||
|
let _ = self.gpu.device()
|
||||||
|
.reset_fence(&frame.fences[0])
|
||||||
|
.map_err(|_| "Failed to reset fence")?;
|
||||||
|
}
|
||||||
|
|
||||||
|
trace!("Recording CommandBuffer...");
|
||||||
|
unsafe {
|
||||||
|
use gfx_hal::command::{
|
||||||
|
CommandBufferFlags,
|
||||||
|
SubpassContents,
|
||||||
|
ClearValue,
|
||||||
|
ClearColor,
|
||||||
|
CommandBuffer,
|
||||||
|
};
|
||||||
|
|
||||||
|
frame.command_buffer.begin_primary(CommandBufferFlags::ONE_TIME_SUBMIT);
|
||||||
|
|
||||||
|
let clear_value = ClearValue {color: ClearColor{float32: color}};
|
||||||
|
|
||||||
|
frame.command_buffer.begin_render_pass(
|
||||||
|
&swap_system.render_pass,
|
||||||
|
&frame.framebuffer.as_ref().unwrap(),
|
||||||
|
swap_system.render_area,
|
||||||
|
iter::once(clear_value),
|
||||||
|
SubpassContents::Inline,
|
||||||
|
);
|
||||||
|
frame.command_buffer.end_render_pass();
|
||||||
|
frame.command_buffer.finish();
|
||||||
|
}
|
||||||
|
|
||||||
|
trace!("Submiting to queue...");
|
||||||
|
let submission = Submission {
|
||||||
|
command_buffers: iter::once(&*frame.command_buffer),
|
||||||
|
wait_semaphores: None,
|
||||||
|
signal_semaphores: iter::once(&frame.signal_semaphores[0]),
|
||||||
|
};
|
||||||
|
|
||||||
|
unsafe {
|
||||||
|
use gfx_hal::queue::CommandQueue;
|
||||||
|
|
||||||
|
self.gpu.queue_mut().submit(submission, Some(&frame.fences[0]));
|
||||||
|
}
|
||||||
|
|
||||||
|
let result = swap_system.present_frame(frame, &mut self.gpu);
|
||||||
|
if result.is_err() {
|
||||||
|
swap_system.recreate(&mut self.gpu).unwrap();
|
||||||
|
}
|
||||||
|
|
||||||
|
Ok(())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -162,7 +162,7 @@ where
|
|||||||
trace!("Creating CommandPool...");
|
trace!("Creating CommandPool...");
|
||||||
device
|
device
|
||||||
.create_command_pool(queue_group.family,
|
.create_command_pool(queue_group.family,
|
||||||
CommandPoolCreateFlags::empty())
|
CommandPoolCreateFlags::RESET_INDIVIDUAL)
|
||||||
.map_err(|_| "Could not create CommandPool")?
|
.map_err(|_| "Could not create CommandPool")?
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -4,11 +4,11 @@ use log::{debug, error, info, trace, warn};
|
|||||||
use std::{
|
use std::{
|
||||||
mem::ManuallyDrop,
|
mem::ManuallyDrop,
|
||||||
ptr::read,
|
ptr::read,
|
||||||
collections::HashMap,
|
collections::VecDeque,
|
||||||
};
|
};
|
||||||
|
|
||||||
use gfx_hal::{
|
use gfx_hal::{
|
||||||
window::{Extent2D, AcquireError},
|
window::{Extent2D, AcquireError, PresentationSurface, SurfaceCapabilities, SwapchainConfig},
|
||||||
pso::Rect as GfxRect,
|
pso::Rect as GfxRect,
|
||||||
format::Format,
|
format::Format,
|
||||||
};
|
};
|
||||||
@ -24,11 +24,9 @@ pub struct SwapSystem<B: gfx_hal::Backend> {
|
|||||||
surface: ManuallyDrop<B::Surface>,
|
surface: ManuallyDrop<B::Surface>,
|
||||||
format: Format,
|
format: Format,
|
||||||
extent: Extent2D,
|
extent: Extent2D,
|
||||||
render_area: GfxRect, //TODO may not be needed (duplicate of extent)
|
pub render_area: GfxRect, //TODO may not be needed (duplicate of extent)
|
||||||
swapchain: ManuallyDrop<B::Swapchain>,
|
pub render_pass: ManuallyDrop<B::RenderPass>,
|
||||||
spare_semaphore: ManuallyDrop<B::Semaphore>,
|
frames: VecDeque<Frame<B>>,
|
||||||
render_pass: ManuallyDrop<B::RenderPass>,
|
|
||||||
frames: HashMap<usize, Frame<B>>,
|
|
||||||
frame_nb: usize,
|
frame_nb: usize,
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -36,36 +34,26 @@ impl<B> SwapSystem<B>
|
|||||||
where
|
where
|
||||||
B: gfx_hal::Backend,
|
B: gfx_hal::Backend,
|
||||||
{
|
{
|
||||||
pub fn drop(&mut self, gpu: &mut Gpu<B>, instance: &B::Instance) {
|
pub fn drop(&mut self, gpu: &mut Gpu<B>) -> B::Surface {
|
||||||
use gfx_hal::{
|
use gfx_hal::device::Device;
|
||||||
device::Device,
|
|
||||||
Instance,
|
|
||||||
};
|
|
||||||
|
|
||||||
debug!("Dropping SwapSystem...");
|
debug!("Dropping SwapSystem...");
|
||||||
for (_, mut frame) in self.frames.drain() {
|
for mut frame in self.frames.drain(..) {
|
||||||
frame.drop(gpu);
|
frame.drop(gpu);
|
||||||
}
|
}
|
||||||
unsafe {
|
unsafe {
|
||||||
gpu.device().destroy_render_pass(
|
gpu.device().destroy_render_pass(
|
||||||
ManuallyDrop::into_inner(read(&mut self.render_pass)));
|
ManuallyDrop::into_inner(read(&mut self.render_pass)));
|
||||||
gpu.device().destroy_semaphore(
|
|
||||||
ManuallyDrop::into_inner(read(&mut self.spare_semaphore)));
|
|
||||||
gpu.device().destroy_swapchain(
|
|
||||||
ManuallyDrop::into_inner(read(&mut self.swapchain)));
|
|
||||||
//render_area extent and format can be dropped automatically
|
//render_area extent and format can be dropped automatically
|
||||||
instance.destroy_surface(
|
self.surface.unconfigure_swapchain(gpu.device());
|
||||||
ManuallyDrop::into_inner(read(&mut self.surface)));
|
trace!("SwapSystem dropped !");
|
||||||
|
ManuallyDrop::take(&mut self.surface)
|
||||||
}
|
}
|
||||||
trace!("SwapSystem dropped !");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn new(gpu: &mut Gpu<B>, mut surface: B::Surface)
|
pub fn new(gpu: &mut Gpu<B>, mut surface: B::Surface)
|
||||||
-> Result<SwapSystem<B>, &'static str>
|
-> Result<SwapSystem<B>, &'static str>
|
||||||
{
|
{
|
||||||
use gfx_hal::{
|
|
||||||
window::SwapchainConfig,
|
|
||||||
};
|
|
||||||
|
|
||||||
debug!("Creating SwapSystem...");
|
debug!("Creating SwapSystem...");
|
||||||
trace!("Obtaining surface capabilities...");
|
trace!("Obtaining surface capabilities...");
|
||||||
@ -99,92 +87,17 @@ where
|
|||||||
let render_area = GfxRect{x: 0, y: 0, w: extent.width as i16, h: extent.height as i16};
|
let render_area = GfxRect{x: 0, y: 0, w: extent.width as i16, h: extent.height as i16};
|
||||||
|
|
||||||
trace!("Generating Swapchain configuration...");
|
trace!("Generating Swapchain configuration...");
|
||||||
let (swapchain_config, frame_nb) = {
|
let (swapchain_config, frame_nb) =
|
||||||
|
generate_swapchain_config(capabilities, &format, &extent)?;
|
||||||
let present_mode = {
|
|
||||||
use gfx_hal::window::PresentMode;
|
|
||||||
|
|
||||||
[PresentMode::MAILBOX, PresentMode::FIFO, PresentMode::RELAXED,
|
|
||||||
PresentMode::IMMEDIATE]
|
|
||||||
.iter()
|
|
||||||
.cloned()
|
|
||||||
.find(|pm| capabilities.present_modes.contains(*pm))
|
|
||||||
.ok_or("No PresentMode values specified!")?
|
|
||||||
};
|
|
||||||
|
|
||||||
let composite_alpha_mode = {
|
|
||||||
use gfx_hal::window::CompositeAlphaMode;
|
|
||||||
|
|
||||||
[CompositeAlphaMode::OPAQUE, CompositeAlphaMode::INHERIT,
|
|
||||||
CompositeAlphaMode::PREMULTIPLIED, CompositeAlphaMode::POSTMULTIPLIED]
|
|
||||||
.iter()
|
|
||||||
.cloned()
|
|
||||||
.find(|ca| capabilities.composite_alpha_modes.contains(*ca))
|
|
||||||
.ok_or("No CompositeAlpha values specified!")?
|
|
||||||
};
|
|
||||||
|
|
||||||
let image_count = {
|
|
||||||
use std::cmp::{min, max};
|
|
||||||
use gfx_hal::window::PresentMode;
|
|
||||||
|
|
||||||
let count = match present_mode {
|
|
||||||
PresentMode::MAILBOX => 3,
|
|
||||||
_ => 2, //TODO to be checked
|
|
||||||
};
|
|
||||||
max(capabilities.image_count.start().clone(),
|
|
||||||
min(capabilities.image_count.end().clone(), count))
|
|
||||||
};
|
|
||||||
|
|
||||||
warn!("Hard-coding number of layers per image !");
|
|
||||||
let image_layers = 1;
|
|
||||||
|
|
||||||
let image_usage = {
|
|
||||||
use gfx_hal::image::Usage;
|
|
||||||
|
|
||||||
if capabilities.usage.contains(Usage::COLOR_ATTACHMENT) {
|
|
||||||
Usage::COLOR_ATTACHMENT
|
|
||||||
} else {
|
|
||||||
Err("The Surface isn't capable of supporting color!")?
|
|
||||||
}};
|
|
||||||
|
|
||||||
(
|
|
||||||
SwapchainConfig {
|
|
||||||
present_mode,
|
|
||||||
composite_alpha_mode,
|
|
||||||
format: format.clone(),
|
|
||||||
extent: extent.clone(),
|
|
||||||
image_count: image_count.clone(),
|
|
||||||
image_layers,
|
|
||||||
image_usage,
|
|
||||||
},
|
|
||||||
image_count as usize
|
|
||||||
)
|
|
||||||
};
|
|
||||||
// //TODO improve swapchain configuration
|
|
||||||
// let swapchain_config = SwapchainConfig::from_caps(&capabilities, format, extent);
|
|
||||||
// let swapchain_config = swapchain_config.with_image_count(3);
|
|
||||||
debug!("Swapchain configuration : {:#?}", swapchain_config);
|
debug!("Swapchain configuration : {:#?}", swapchain_config);
|
||||||
|
|
||||||
trace!("Creating Swapchain...");
|
trace!("Configuring Swapchain...");
|
||||||
let (swapchain, backbuffer) = unsafe {
|
let _ = unsafe {
|
||||||
use gfx_hal::device::Device;
|
surface
|
||||||
|
.configure_swapchain(gpu.device(), swapchain_config)
|
||||||
gpu.device()
|
|
||||||
.create_swapchain(&mut surface, swapchain_config, None)
|
|
||||||
.map_err(|_| "Failed to create swapchain and backbuffer")?
|
.map_err(|_| "Failed to create swapchain and backbuffer")?
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
trace!("Creating spare Semaphore...");
|
|
||||||
let spare_semaphore = {
|
|
||||||
use gfx_hal::device::Device;
|
|
||||||
|
|
||||||
gpu.device()
|
|
||||||
.create_semaphore()
|
|
||||||
.map_err(|_| "Could not create sempahore")?
|
|
||||||
};
|
|
||||||
|
|
||||||
trace!("Creating RenderPass...");
|
trace!("Creating RenderPass...");
|
||||||
let render_pass = {
|
let render_pass = {
|
||||||
use gfx_hal::{
|
use gfx_hal::{
|
||||||
@ -219,11 +132,11 @@ where
|
|||||||
};
|
};
|
||||||
|
|
||||||
warn!("Generating hard-coded number of frames !");
|
warn!("Generating hard-coded number of frames !");
|
||||||
let mut frames = HashMap::with_capacity(frame_nb);
|
let mut frames = VecDeque::with_capacity(frame_nb);
|
||||||
for i in 0..frame_nb {
|
for _ in 0..frame_nb {
|
||||||
let frame = Frame::new(gpu, &backbuffer[i], &format, &render_pass, &extent)
|
let frame = Frame::new(gpu)
|
||||||
.map_err(|_| "Could not create frame")?;
|
.map_err(|_| "Could not create frame")?;
|
||||||
frames.insert(i, frame);
|
frames.push_back(frame);
|
||||||
};
|
};
|
||||||
|
|
||||||
let frame_nb = frames.len();
|
let frame_nb = frames.len();
|
||||||
@ -234,67 +147,167 @@ where
|
|||||||
format,
|
format,
|
||||||
extent,
|
extent,
|
||||||
render_area,
|
render_area,
|
||||||
swapchain: ManuallyDrop::new(swapchain),
|
|
||||||
spare_semaphore: ManuallyDrop::new(spare_semaphore),
|
|
||||||
render_pass: ManuallyDrop::new(render_pass),
|
render_pass: ManuallyDrop::new(render_pass),
|
||||||
frames,
|
frames,
|
||||||
frame_nb,
|
frame_nb,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn configure_render_pass(&mut self, color: [f32; 4]) -> Result<(), &'static str> {
|
pub fn recreate(&mut self, gpu: &mut Gpu<B>) -> Result<(), &'static str> {
|
||||||
|
|
||||||
if self.frames.len() != self.frame_nb {
|
|
||||||
return Err("Tried to configure RenderPass with frames acquired");
|
|
||||||
}
|
|
||||||
|
|
||||||
debug!("Configuring Color RenderPass...");
|
trace!("Obtaining surface capabilities...");
|
||||||
for (_, frame) in &mut self.frames {
|
let capabilities = {
|
||||||
frame.record_command_buffer(&self.render_pass, self.render_area.clone(), color);
|
use gfx_hal::window::Surface;
|
||||||
}
|
|
||||||
|
self.surface.capabilities(&gpu.adapter().physical_device)
|
||||||
|
};
|
||||||
|
debug!("Surface capabitlities : {:#?}", capabilities);
|
||||||
|
|
||||||
|
trace!("Getting surface's render area size...");
|
||||||
|
self.extent = capabilities.current_extent
|
||||||
|
.unwrap_or(*capabilities.extents.end())
|
||||||
|
.clone();
|
||||||
|
self.render_area =
|
||||||
|
GfxRect{x: 0, y: 0, w: self.extent.width as i16, h: self.extent.height as i16};
|
||||||
|
|
||||||
|
trace!("Generating Swapchain configuration...");
|
||||||
|
let (swapchain_config, _frame_nb) = //TODO check frame nb change
|
||||||
|
generate_swapchain_config(capabilities, &self.format, &self.extent)?;
|
||||||
|
debug!("Swapchain configuration : {:#?}", swapchain_config);
|
||||||
|
|
||||||
|
trace!("Configuring Swapchain...");
|
||||||
|
let _ = unsafe {
|
||||||
|
self.surface
|
||||||
|
.configure_swapchain(gpu.device(), swapchain_config)
|
||||||
|
.map_err(|_| "Failed to create swapchain and backbuffer")?
|
||||||
|
};
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn acquire_frame(&mut self) -> Result<(Frame<B>, u32), AcquireError> {
|
pub fn acquire_frame(&mut self, gpu: &Gpu<B>) -> Result<Frame<B>, AcquireError> {
|
||||||
use gfx_hal::window::Swapchain;
|
|
||||||
|
|
||||||
trace!("Acquiring Frame...");
|
trace!("Acquiring Frame...");
|
||||||
let image_id = unsafe {
|
let image = unsafe {
|
||||||
match self.swapchain.acquire_image(core::u64::MAX, Some(&self.spare_semaphore), None) {
|
match self.surface.acquire_image(core::u64::MAX) {
|
||||||
Ok((image_id, suboptimal)) => {
|
Ok((image, suboptimal)) => {
|
||||||
match suboptimal {
|
match suboptimal {
|
||||||
Some(_) => return Err(AcquireError::OutOfDate),
|
Some(_) => return Err(AcquireError::OutOfDate),
|
||||||
None => image_id,
|
None => image,
|
||||||
}},
|
}},
|
||||||
Err(err) => return Err(err),
|
Err(err) => return Err(err),
|
||||||
}};
|
}};
|
||||||
|
let mut frame = self.frames.pop_back().unwrap();
|
||||||
|
|
||||||
//TODO give back image to swaphain
|
trace!("Creating Framebuffer...");
|
||||||
//debug!("image id : {}", image_id);
|
let framebuffer = unsafe {
|
||||||
let mut frame = match self.frames.remove(&(image_id as usize)) {
|
use gfx_hal::device::Device;
|
||||||
Some(frame) => frame,
|
use std::borrow::Borrow;
|
||||||
None => return Err(AcquireError::NotReady),
|
|
||||||
|
gpu.device()
|
||||||
|
.create_framebuffer(&self.render_pass,
|
||||||
|
vec![image.borrow()],
|
||||||
|
self.extent.clone().to_extent())
|
||||||
|
.unwrap() //TODO improve that
|
||||||
};
|
};
|
||||||
frame.swap_semaphore(&mut self.spare_semaphore);
|
|
||||||
|
frame.link_swapchain_image(image, framebuffer);
|
||||||
|
|
||||||
Ok((frame, image_id))
|
Ok(frame)
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn present_frame(&mut self, frame: Frame<B>, image_id: u32, queue: &mut B::CommandQueue)
|
pub fn present_frame(&mut self, mut frame: Frame<B>, gpu: &mut Gpu<B>)
|
||||||
-> Result<(), &'static str> {
|
-> Result<(), &'static str> {
|
||||||
use gfx_hal::window::Swapchain;
|
use gfx_hal::{
|
||||||
|
queue::CommandQueue,
|
||||||
|
device::Device,
|
||||||
|
};
|
||||||
|
|
||||||
|
let (image, framebuffer) = frame
|
||||||
|
.unlink_swapchain_image()
|
||||||
|
.unwrap(); //TODO improve that
|
||||||
|
|
||||||
trace!("Presenting Frame...");
|
trace!("Presenting Frame...");
|
||||||
let _result = unsafe {
|
let _ = unsafe {
|
||||||
self.swapchain
|
gpu.queue_mut()
|
||||||
.present(queue, image_id, Some(frame.get_present_semaphore()))
|
.present(&mut self.surface, image, Some(&frame.signal_semaphores[0]))
|
||||||
.map_err(|_| "Failed to present into the swapchain")?;
|
.map_err(|_| "Failed to present into the swapchain")?;
|
||||||
};
|
};
|
||||||
|
|
||||||
self.frames.insert(image_id as usize, frame);
|
self.frames.push_front(frame);
|
||||||
|
|
||||||
|
trace!("Destroying Framebuffer...");
|
||||||
|
unsafe {
|
||||||
|
gpu.device().destroy_framebuffer(framebuffer);
|
||||||
|
}
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn generate_swapchain_config(capabilities: SurfaceCapabilities,
|
||||||
|
format: &Format,
|
||||||
|
extent: &Extent2D)
|
||||||
|
-> Result<(SwapchainConfig, usize), &'static str> {
|
||||||
|
|
||||||
|
trace!("Generating Swapchain configuration...");
|
||||||
|
let present_mode = {
|
||||||
|
use gfx_hal::window::PresentMode;
|
||||||
|
|
||||||
|
[PresentMode::MAILBOX, PresentMode::FIFO, PresentMode::RELAXED,
|
||||||
|
PresentMode::IMMEDIATE]
|
||||||
|
.iter()
|
||||||
|
.cloned()
|
||||||
|
.find(|pm| capabilities.present_modes.contains(*pm))
|
||||||
|
.ok_or("No PresentMode values specified!")?
|
||||||
|
};
|
||||||
|
|
||||||
|
let composite_alpha_mode = {
|
||||||
|
use gfx_hal::window::CompositeAlphaMode;
|
||||||
|
|
||||||
|
[CompositeAlphaMode::OPAQUE, CompositeAlphaMode::INHERIT,
|
||||||
|
CompositeAlphaMode::PREMULTIPLIED, CompositeAlphaMode::POSTMULTIPLIED]
|
||||||
|
.iter()
|
||||||
|
.cloned()
|
||||||
|
.find(|ca| capabilities.composite_alpha_modes.contains(*ca))
|
||||||
|
.ok_or("No CompositeAlpha values specified!")?
|
||||||
|
};
|
||||||
|
|
||||||
|
let image_count = {
|
||||||
|
use std::cmp::{min, max};
|
||||||
|
use gfx_hal::window::PresentMode;
|
||||||
|
|
||||||
|
let count = match present_mode {
|
||||||
|
PresentMode::MAILBOX => 3,
|
||||||
|
_ => 2, //TODO to be checked
|
||||||
|
};
|
||||||
|
max(capabilities.image_count.start().clone(),
|
||||||
|
min(capabilities.image_count.end().clone(), count))
|
||||||
|
};
|
||||||
|
|
||||||
|
warn!("Hard-coding number of layers per image !");
|
||||||
|
let image_layers = 1;
|
||||||
|
|
||||||
|
let image_usage = {
|
||||||
|
use gfx_hal::image::Usage;
|
||||||
|
|
||||||
|
if capabilities.usage.contains(Usage::COLOR_ATTACHMENT) {
|
||||||
|
Usage::COLOR_ATTACHMENT
|
||||||
|
} else {
|
||||||
|
Err("The Surface isn't capable of supporting color!")?
|
||||||
|
}};
|
||||||
|
|
||||||
|
Ok ((
|
||||||
|
SwapchainConfig {
|
||||||
|
present_mode,
|
||||||
|
composite_alpha_mode,
|
||||||
|
format: format.clone(),
|
||||||
|
extent: extent.clone(),
|
||||||
|
image_count: image_count.clone(),
|
||||||
|
image_layers,
|
||||||
|
image_usage,
|
||||||
|
},
|
||||||
|
image_count as usize
|
||||||
|
))
|
||||||
|
}
|
||||||
|
|
||||||
|
|||||||
@ -7,24 +7,19 @@ use std::{
|
|||||||
iter,
|
iter,
|
||||||
};
|
};
|
||||||
|
|
||||||
use gfx_hal::{
|
use gfx_hal::window::{PresentationSurface};
|
||||||
window::Extent2D,
|
|
||||||
format::Format,
|
|
||||||
queue::Submission,
|
|
||||||
pso::Rect as GfxRect,
|
|
||||||
};
|
|
||||||
|
|
||||||
use super::super::gpu::Gpu;
|
use super::super::gpu::Gpu;
|
||||||
|
|
||||||
//--Frame implementation----------------------------------------------------------------------------
|
//--Frame implementation----------------------------------------------------------------------------
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub struct Frame<B: gfx_hal::Backend> {
|
pub struct Frame<B: gfx_hal::Backend> {
|
||||||
wait_semaphores: Vec<B::Semaphore>,
|
pub wait_semaphores: Vec<B::Semaphore>,
|
||||||
signal_semaphores: Vec<B::Semaphore>,
|
pub signal_semaphores: Vec<B::Semaphore>,
|
||||||
fences: Vec<B::Fence>,
|
pub fences: Vec<B::Fence>,
|
||||||
image_view: ManuallyDrop<B::ImageView>,
|
pub command_buffer: ManuallyDrop<B::CommandBuffer>,
|
||||||
framebuffer: ManuallyDrop<B::Framebuffer>,
|
image_view: Option<<B::Surface as PresentationSurface<B>>::SwapchainImage>,
|
||||||
command_buffer: ManuallyDrop<B::CommandBuffer>,
|
pub framebuffer: Option<B::Framebuffer>,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<B> Frame<B>
|
impl<B> Frame<B>
|
||||||
@ -39,12 +34,11 @@ where
|
|||||||
|
|
||||||
trace!("Dropping Frame...");
|
trace!("Dropping Frame...");
|
||||||
unsafe {
|
unsafe {
|
||||||
|
if self.image_view.is_some() {
|
||||||
|
warn!("Dropping non-presented frame !");
|
||||||
|
}
|
||||||
gpu.command_pool_mut().free(
|
gpu.command_pool_mut().free(
|
||||||
iter::once(ManuallyDrop::into_inner(read(&mut self.command_buffer))));
|
iter::once(ManuallyDrop::into_inner(read(&mut self.command_buffer))));
|
||||||
gpu.device().destroy_framebuffer(
|
|
||||||
ManuallyDrop::into_inner(read(&mut self.framebuffer)));
|
|
||||||
gpu.device().destroy_image_view(
|
|
||||||
ManuallyDrop::into_inner(read(&mut self.image_view)));
|
|
||||||
for fence in self.fences.drain(..) {
|
for fence in self.fences.drain(..) {
|
||||||
gpu.device().destroy_fence(fence);
|
gpu.device().destroy_fence(fence);
|
||||||
}
|
}
|
||||||
@ -58,12 +52,7 @@ where
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn new(gpu: &mut Gpu<B>,
|
pub fn new(gpu: &mut Gpu<B>) -> Result<Frame<B>, &'static str>
|
||||||
image: &B::Image,
|
|
||||||
format: &Format,
|
|
||||||
render_pass: &B::RenderPass,
|
|
||||||
extent: &Extent2D)
|
|
||||||
-> Result<Frame<B>, &'static str>
|
|
||||||
{
|
{
|
||||||
|
|
||||||
debug!("Creating Frame...");
|
debug!("Creating Frame...");
|
||||||
@ -86,41 +75,7 @@ where
|
|||||||
|
|
||||||
(wait_semaphores, signal_semaphores, fences)
|
(wait_semaphores, signal_semaphores, fences)
|
||||||
};
|
};
|
||||||
|
|
||||||
trace!("Creating ImageView...");
|
|
||||||
let image_view = unsafe {
|
|
||||||
use gfx_hal::{
|
|
||||||
image::{ViewKind, SubresourceRange},
|
|
||||||
format::{Swizzle, Aspects},
|
|
||||||
device::Device,
|
|
||||||
};
|
|
||||||
|
|
||||||
gpu.device()
|
|
||||||
.create_image_view(
|
|
||||||
image,
|
|
||||||
ViewKind::D2,
|
|
||||||
format.clone(),
|
|
||||||
Swizzle::NO,
|
|
||||||
SubresourceRange {
|
|
||||||
aspects : Aspects::COLOR,
|
|
||||||
levels : 0..1,
|
|
||||||
layers : 0..1,
|
|
||||||
},
|
|
||||||
)
|
|
||||||
.map_err(|_| "Could not create ImageView")?
|
|
||||||
};
|
|
||||||
|
|
||||||
trace!("Creating Framebuffer...");
|
|
||||||
let framebuffer = unsafe {
|
|
||||||
use gfx_hal::device::Device;
|
|
||||||
|
|
||||||
gpu.device()
|
|
||||||
.create_framebuffer(render_pass,
|
|
||||||
vec![&image_view],
|
|
||||||
extent.clone().to_extent())
|
|
||||||
.map_err(|_| "Could not create FrameBuffer")?
|
|
||||||
};
|
|
||||||
|
|
||||||
trace!("Allocating CommandBuffer...");
|
trace!("Allocating CommandBuffer...");
|
||||||
let command_buffer = unsafe {
|
let command_buffer = unsafe {
|
||||||
use gfx_hal::{
|
use gfx_hal::{
|
||||||
@ -136,86 +91,29 @@ where
|
|||||||
wait_semaphores,
|
wait_semaphores,
|
||||||
signal_semaphores,
|
signal_semaphores,
|
||||||
fences,
|
fences,
|
||||||
image_view: ManuallyDrop::new(image_view),
|
|
||||||
framebuffer: ManuallyDrop::new(framebuffer),
|
|
||||||
command_buffer: ManuallyDrop::new(command_buffer),
|
command_buffer: ManuallyDrop::new(command_buffer),
|
||||||
|
image_view: None,
|
||||||
|
framebuffer: None,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn sync_gpu(&self, gpu: &Gpu<B>) -> Result<(), &'static str>{
|
pub fn link_swapchain_image(&mut self,
|
||||||
use gfx_hal::device::Device;
|
image: <B::Surface as PresentationSurface<B>>::SwapchainImage,
|
||||||
|
framebuffer: B::Framebuffer) {
|
||||||
trace!("Waiting for Frame...");
|
|
||||||
unsafe {
|
|
||||||
let _ = gpu.device()
|
|
||||||
.wait_for_fence(&self.fences[0], !0)
|
|
||||||
.map_err(|_| "Failed to wait for Fence")?;
|
|
||||||
let _ = gpu.device()
|
|
||||||
.reset_fence(&self.fences[0])
|
|
||||||
.map_err(|_| "Failed to reset fence")?;
|
|
||||||
}
|
|
||||||
|
|
||||||
Ok(())
|
self.image_view = Some(image);
|
||||||
|
self.framebuffer = Some(framebuffer);
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn record_command_buffer(&mut self,
|
pub fn unlink_swapchain_image(&mut self)
|
||||||
render_pass: &B::RenderPass,
|
-> Result<(<B::Surface as PresentationSurface<B>>::SwapchainImage,
|
||||||
render_area: GfxRect,
|
B::Framebuffer), &'static str> {
|
||||||
color: [f32; 4]) {
|
|
||||||
|
|
||||||
trace!("Recording CommandBuffer...");
|
match (self.image_view.take(), self.framebuffer.take()) {
|
||||||
|
(Some(image_view), Some(framebuffer)) => Some((image_view, framebuffer)),
|
||||||
unsafe {
|
_ => None,
|
||||||
use gfx_hal::command::{
|
}
|
||||||
CommandBufferFlags,
|
.ok_or("Can not unlink non-linked Frame !")
|
||||||
SubpassContents,
|
|
||||||
ClearValue,
|
|
||||||
ClearColor,
|
|
||||||
CommandBuffer,
|
|
||||||
};
|
|
||||||
|
|
||||||
self.command_buffer.begin_primary(CommandBufferFlags::EMPTY);
|
|
||||||
|
|
||||||
let clear_value = ClearValue {color: ClearColor{float32: color}};
|
|
||||||
|
|
||||||
self.command_buffer.begin_render_pass(
|
|
||||||
render_pass,
|
|
||||||
&self.framebuffer,
|
|
||||||
render_area,
|
|
||||||
iter::once(clear_value),
|
|
||||||
SubpassContents::Inline,
|
|
||||||
);
|
|
||||||
self.command_buffer.end_render_pass();
|
|
||||||
self.command_buffer.finish();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn submit(&self, queue: &mut B::CommandQueue) {
|
|
||||||
use gfx_hal::pso::PipelineStage;
|
|
||||||
|
|
||||||
trace!("Submiting to queue...");
|
|
||||||
let submission = Submission {
|
|
||||||
command_buffers: iter::once(&*self.command_buffer),
|
|
||||||
wait_semaphores: iter::once((&self.wait_semaphores[0],
|
|
||||||
PipelineStage::COLOR_ATTACHMENT_OUTPUT)),
|
|
||||||
signal_semaphores: iter::once(&self.signal_semaphores[0]),
|
|
||||||
};
|
|
||||||
|
|
||||||
unsafe {
|
|
||||||
use gfx_hal::queue::CommandQueue;
|
|
||||||
|
|
||||||
queue.submit(submission, Some(&self.fences[0]));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn swap_semaphore(&mut self, semaphore: &mut B::Semaphore) {
|
|
||||||
|
|
||||||
std::mem::swap(&mut self.wait_semaphores[0], semaphore);
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn get_present_semaphore(&self) -> &B::Semaphore {
|
|
||||||
|
|
||||||
&self.signal_semaphores[0]
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user