From 2952a3cea1012bcb64b086c3507a25551d349add Mon Sep 17 00:00:00 2001 From: galister <22305755+galister@users.noreply.github.com> Date: Mon, 7 Apr 2025 02:33:40 +0900 Subject: [PATCH] update vulkano --- Cargo.lock | 261 +++++++++++++++++++++++--------------------- Cargo.toml | 6 +- src/graphics/mod.rs | 107 ++++++++---------- 3 files changed, 186 insertions(+), 188 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index b803325..474dc46 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -248,11 +248,11 @@ checksum = "175571dd1d178ced59193a6fc02dde1b972eb0bc56c892cde9beeceac5bf0f6b" [[package]] name = "ash" -version = "0.37.3+1.3.251" +version = "0.38.0+1.3.281" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39e9c3835d686b0a6084ab4234fcd1b07dbf6e4767dce60874b12356a25ecd4a" +checksum = "0bb44936d800fea8f016d7f2311c6a4f97aebd5dc86f09906139ec848cf3a46f" dependencies = [ - "libloading 0.7.4", + "libloading", ] [[package]] @@ -652,7 +652,7 @@ version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2c132eebf10f5cad5289222520a4a058514204aed6d791f1cf4fe8088b82d15f" dependencies = [ - "objc2", + "objc2 0.5.2", ] [[package]] @@ -846,7 +846,7 @@ checksum = "0b023947811758c97c59bf9d1c188fd619ad4718dcaa767947df1cadb14f39f4" dependencies = [ "glob", "libc", - "libloading 0.8.6", + "libloading", ] [[package]] @@ -949,7 +949,7 @@ dependencies = [ "serde", "serde_json", "toml", - "winnow 0.7.4", + "winnow", "yaml-rust2", ] @@ -1327,7 +1327,7 @@ version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "330c60081dcc4c72131f8eb70510f1ac07223e5d4163db481a04a0befcffa412" dependencies = [ - "libloading 0.8.6", + "libloading", ] [[package]] @@ -2331,16 +2331,6 @@ dependencies = [ "pkg-config", ] -[[package]] -name = "libloading" -version = "0.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b67380fd3b2fbe7527a606e18729d21c6f3951633d0500574c4dc22d2d638b9f" -dependencies = [ - "cfg-if", - "winapi", -] - [[package]] name = "libloading" version = "0.8.6" @@ -2474,15 +2464,6 @@ dependencies = [ "libc", ] -[[package]] -name = "malloc_buf" -version = "0.0.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62bb907fe88d54d8d9ce32a3cceab4218ed2f6b7d35617cafe9adf84e43919cb" -dependencies = [ - "libc", -] - [[package]] name = "matchers" version = "0.1.0" @@ -2734,21 +2715,12 @@ version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "af1844ef2428cc3e1cb900be36181049ef3d3193c63e43026cfe202983b27a56" dependencies = [ - "proc-macro-crate 3.3.0", + "proc-macro-crate", "proc-macro2", "quote", "syn 2.0.100", ] -[[package]] -name = "objc" -version = "0.2.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "915b1b472bc21c53464d6c8461c9d3af805ba1ef837e1cac254428f4a77177b1" -dependencies = [ - "malloc_buf", -] - [[package]] name = "objc-sys" version = "0.3.5" @@ -2765,6 +2737,15 @@ dependencies = [ "objc2-encode", ] +[[package]] +name = "objc2" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3531f65190d9cff863b77a99857e74c314dd16bf56c538c4b57c7cbc3f3a6e59" +dependencies = [ + "objc2-encode", +] + [[package]] name = "objc2-app-kit" version = "0.2.2" @@ -2774,11 +2755,11 @@ dependencies = [ "bitflags 2.9.0", "block2", "libc", - "objc2", + "objc2 0.5.2", "objc2-core-data", "objc2-core-image", - "objc2-foundation", - "objc2-quartz-core", + "objc2-foundation 0.2.2", + "objc2-quartz-core 0.2.2", ] [[package]] @@ -2789,9 +2770,9 @@ checksum = "74dd3b56391c7a0596a295029734d3c1c5e7e510a4cb30245f8221ccea96b009" dependencies = [ "bitflags 2.9.0", "block2", - "objc2", + "objc2 0.5.2", "objc2-core-location", - "objc2-foundation", + "objc2-foundation 0.2.2", ] [[package]] @@ -2801,8 +2782,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a5ff520e9c33812fd374d8deecef01d4a840e7b41862d849513de77e44aa4889" dependencies = [ "block2", - "objc2", - "objc2-foundation", + "objc2 0.5.2", + "objc2-foundation 0.2.2", ] [[package]] @@ -2813,8 +2794,8 @@ checksum = "617fbf49e071c178c0b24c080767db52958f716d9eabdf0890523aeae54773ef" dependencies = [ "bitflags 2.9.0", "block2", - "objc2", - "objc2-foundation", + "objc2 0.5.2", + "objc2-foundation 0.2.2", ] [[package]] @@ -2824,6 +2805,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "daeaf60f25471d26948a1c2f840e3f7d86f4109e3af4e8e4b5cd70c39690d925" dependencies = [ "bitflags 2.9.0", + "objc2 0.6.0", ] [[package]] @@ -2833,9 +2815,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "55260963a527c99f1819c4f8e3b47fe04f9650694ef348ffd2227e8196d34c80" dependencies = [ "block2", - "objc2", - "objc2-foundation", - "objc2-metal", + "objc2 0.5.2", + "objc2-foundation 0.2.2", + "objc2-metal 0.2.2", ] [[package]] @@ -2845,9 +2827,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "000cfee34e683244f284252ee206a27953279d370e309649dc3ee317b37e5781" dependencies = [ "block2", - "objc2", + "objc2 0.5.2", "objc2-contacts", - "objc2-foundation", + "objc2-foundation 0.2.2", ] [[package]] @@ -2866,7 +2848,18 @@ dependencies = [ "block2", "dispatch", "libc", - "objc2", + "objc2 0.5.2", +] + +[[package]] +name = "objc2-foundation" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3a21c6c9014b82c39515db5b396f91645182611c97d24637cf56ac01e5f8d998" +dependencies = [ + "bitflags 2.9.0", + "objc2 0.6.0", + "objc2-core-foundation", ] [[package]] @@ -2876,9 +2869,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a1a1ae721c5e35be65f01a03b6d2ac13a54cb4fa70d8a5da293d7b0020261398" dependencies = [ "block2", - "objc2", + "objc2 0.5.2", "objc2-app-kit", - "objc2-foundation", + "objc2-foundation 0.2.2", ] [[package]] @@ -2889,8 +2882,19 @@ checksum = "dd0cba1276f6023976a406a14ffa85e1fdd19df6b0f737b063b95f6c8c7aadd6" dependencies = [ "bitflags 2.9.0", "block2", - "objc2", - "objc2-foundation", + "objc2 0.5.2", + "objc2-foundation 0.2.2", +] + +[[package]] +name = "objc2-metal" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "01c41bc8b0e50ea7a5304a56f25e0066f526e99641b46fd7b9ad4421dd35bff6" +dependencies = [ + "bitflags 2.9.0", + "objc2 0.6.0", + "objc2-foundation 0.3.0", ] [[package]] @@ -2901,9 +2905,22 @@ checksum = "e42bee7bff906b14b167da2bac5efe6b6a07e6f7c0a21a7308d40c960242dc7a" dependencies = [ "bitflags 2.9.0", "block2", - "objc2", - "objc2-foundation", - "objc2-metal", + "objc2 0.5.2", + "objc2-foundation 0.2.2", + "objc2-metal 0.2.2", +] + +[[package]] +name = "objc2-quartz-core" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6fb3794501bb1bee12f08dcad8c61f2a5875791ad1c6f47faa71a0f033f20071" +dependencies = [ + "bitflags 2.9.0", + "objc2 0.6.0", + "objc2-core-foundation", + "objc2-foundation 0.3.0", + "objc2-metal 0.3.0", ] [[package]] @@ -2912,8 +2929,8 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0a684efe3dec1b305badae1a28f6555f6ddd3bb2c2267896782858d5a78404dc" dependencies = [ - "objc2", - "objc2-foundation", + "objc2 0.5.2", + "objc2-foundation 0.2.2", ] [[package]] @@ -2924,14 +2941,14 @@ checksum = "b8bb46798b20cd6b91cbd113524c490f1686f4c4e8f49502431415f3512e2b6f" dependencies = [ "bitflags 2.9.0", "block2", - "objc2", + "objc2 0.5.2", "objc2-cloud-kit", "objc2-core-data", "objc2-core-image", "objc2-core-location", - "objc2-foundation", + "objc2-foundation 0.2.2", "objc2-link-presentation", - "objc2-quartz-core", + "objc2-quartz-core 0.2.2", "objc2-symbols", "objc2-uniform-type-identifiers", "objc2-user-notifications", @@ -2944,8 +2961,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "44fa5f9748dbfe1ca6c0b79ad20725a11eca7c2218bceb4b005cb1be26273bfe" dependencies = [ "block2", - "objc2", - "objc2-foundation", + "objc2 0.5.2", + "objc2-foundation 0.2.2", ] [[package]] @@ -2956,9 +2973,9 @@ checksum = "76cfcbf642358e8689af64cee815d139339f3ed8ad05103ed5eaf73db8d84cb3" dependencies = [ "bitflags 2.9.0", "block2", - "objc2", + "objc2 0.5.2", "objc2-core-location", - "objc2-foundation", + "objc2-foundation 0.2.2", ] [[package]] @@ -3005,7 +3022,7 @@ version = "0.18.0" source = "git+https://github.com/galister/openxrs?rev=af4a55d#af4a55df60125491c80c61464c824219c6019b76" dependencies = [ "libc", - "libloading 0.8.6", + "libloading", "ndk-context", "openxr-sys", ] @@ -3338,22 +3355,13 @@ dependencies = [ "syn 2.0.100", ] -[[package]] -name = "proc-macro-crate" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e8366a6159044a37876a2b9817124296703c586a5c92e2c53751fa06d8d43e8" -dependencies = [ - "toml_edit 0.20.7", -] - [[package]] name = "proc-macro-crate" version = "3.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "edce586971a4dfaa28950c6f18ed55e0406c1ab88bbce2c6f6293a7aaba73d35" dependencies = [ - "toml_edit 0.22.24", + "toml_edit", ] [[package]] @@ -3507,6 +3515,18 @@ version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "20675572f6f24e9e76ef639bc5552774ed45f1c30e2951e1e99c59888861c539" +[[package]] +name = "raw-window-metal" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "40d213455a5f1dc59214213c7330e074ddf8114c9a42411eb890c767357ce135" +dependencies = [ + "objc2 0.6.0", + "objc2-core-foundation", + "objc2-foundation 0.3.0", + "objc2-quartz-core 0.3.0", +] + [[package]] name = "recvmsg" version = "1.0.0" @@ -3889,6 +3909,12 @@ dependencies = [ "autocfg", ] +[[package]] +name = "slabbin" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9db491c0d4152a069911a0fbdaca959691bf0b9d7110d98a7ed1c8e59b79ab30" + [[package]] name = "slice-of-array" version = "0.3.2" @@ -3921,7 +3947,7 @@ dependencies = [ "gl_generator", "indexmap 2.9.0", "libc", - "libloading 0.8.6", + "libloading", "profiling", "rand 0.8.5", "rustix 0.38.44", @@ -4242,7 +4268,7 @@ dependencies = [ "serde", "serde_spanned", "toml_datetime", - "toml_edit 0.22.24", + "toml_edit", ] [[package]] @@ -4254,17 +4280,6 @@ dependencies = [ "serde", ] -[[package]] -name = "toml_edit" -version = "0.20.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70f427fce4d84c72b5b732388bf4a9f4531b53f74e2887e3ecb2481f68f66d81" -dependencies = [ - "indexmap 2.9.0", - "toml_datetime", - "winnow 0.5.40", -] - [[package]] name = "toml_edit" version = "0.22.24" @@ -4275,7 +4290,7 @@ dependencies = [ "serde", "serde_spanned", "toml_datetime", - "winnow 0.7.4", + "winnow", ] [[package]] @@ -4465,48 +4480,52 @@ checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" [[package]] name = "vk-parse" -version = "0.12.0" +version = "0.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81086c28be67a8759cd80cbb3c8f7b520e0874605fc5eb74d5a1c9c2d1878e79" +checksum = "3859da4d7b98bec73e68fb65815d47a263819c415c90eed42b80440a02cbce8c" dependencies = [ "xml-rs", ] [[package]] name = "vulkano" -version = "0.34.0" -source = "git+https://github.com/vulkano-rs/vulkano?rev=94f50f1#94f50f18bd25971ea123adb8b5782ad65a8f085c" +version = "0.35.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08840c2b51759a6f88f26f5ea378bc8b5c199a5b4760ddda292304be087249c4" dependencies = [ - "ahash", "ash", "bytemuck", - "core-graphics-types", "crossbeam-queue", + "foldhash", "half", "heck 0.4.1", "indexmap 2.9.0", - "libloading 0.8.6", - "objc", + "libloading", + "nom", "once_cell", "parking_lot", "proc-macro2", "quote", "raw-window-handle", - "regex", + "raw-window-metal", "serde", "serde_json", + "slabbin", "smallvec", "thread_local", "vk-parse", "vulkano-macros", + "x11-dl", + "x11rb", ] [[package]] name = "vulkano-macros" -version = "0.34.0" -source = "git+https://github.com/vulkano-rs/vulkano?rev=94f50f1#94f50f18bd25971ea123adb8b5782ad65a8f085c" +version = "0.35.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1dc929c42c9336fd082079ac3ea30126e4a0dfe36fd2e2b3581303f7d140d20f" dependencies = [ - "proc-macro-crate 2.0.0", + "proc-macro-crate", "proc-macro2", "quote", "syn 2.0.100", @@ -4514,10 +4533,11 @@ dependencies = [ [[package]] name = "vulkano-shaders" -version = "0.34.0" -source = "git+https://github.com/vulkano-rs/vulkano?rev=94f50f1#94f50f18bd25971ea123adb8b5782ad65a8f085c" +version = "0.35.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3bf501461be7cef2893c0e62c50945add9763cc482051d29053f6157089d5ea9" dependencies = [ - "ahash", + "foldhash", "heck 0.4.1", "proc-macro2", "quote", @@ -5211,9 +5231,9 @@ dependencies = [ "libc", "memmap2 0.9.5", "ndk 0.9.0", - "objc2", + "objc2 0.5.2", "objc2-app-kit", - "objc2-foundation", + "objc2-foundation 0.2.2", "objc2-ui-kit", "orbclient", "percent-encoding", @@ -5240,15 +5260,6 @@ dependencies = [ "xkbcommon-dl", ] -[[package]] -name = "winnow" -version = "0.5.40" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f593a95398737aeed53e489c785df13f3618e41dbcd6718c6addbf1395aa6876" -dependencies = [ - "memchr", -] - [[package]] name = "winnow" version = "0.7.4" @@ -5379,7 +5390,7 @@ dependencies = [ "as-raw-xcb-connection", "gethostname", "libc", - "libloading 0.8.6", + "libloading", "once_cell", "rustix 0.38.44", "x11rb-protocol", @@ -5567,7 +5578,7 @@ dependencies = [ "tracing", "uds_windows", "windows-sys 0.59.0", - "winnow 0.7.4", + "winnow", "xdg-home", "zbus_macros", "zbus_names", @@ -5580,7 +5591,7 @@ version = "5.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f325ad10eb0d0a3eb060203494c3b7ec3162a01a59db75d2deee100339709fc0" dependencies = [ - "proc-macro-crate 3.3.0", + "proc-macro-crate", "proc-macro2", "quote", "syn 2.0.100", @@ -5597,7 +5608,7 @@ checksum = "7be68e64bf6ce8db94f63e72f0c7eb9a60d733f7e0499e628dfab0f84d6bcb97" dependencies = [ "serde", "static_assertions", - "winnow 0.7.4", + "winnow", "zvariant", ] @@ -5695,7 +5706,7 @@ dependencies = [ "serde", "static_assertions", "url", - "winnow 0.7.4", + "winnow", "zvariant_derive", "zvariant_utils", ] @@ -5706,7 +5717,7 @@ version = "5.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "74170caa85b8b84cc4935f2d56a57c7a15ea6185ccdd7eadb57e6edd90f94b2f" dependencies = [ - "proc-macro-crate 3.3.0", + "proc-macro-crate", "proc-macro2", "quote", "syn 2.0.100", @@ -5724,5 +5735,5 @@ dependencies = [ "serde", "static_assertions", "syn 2.0.100", - "winnow 0.7.4", + "winnow", ] diff --git a/Cargo.toml b/Cargo.toml index 7382470..c783652 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -17,7 +17,7 @@ categories = ["games"] [dependencies] anyhow = "1.0.89" -ash = "^0.37.2" # must match vulkano +ash = "^0.38.0" # must match vulkano chrono = "0.4.38" chrono-tz = "0.10.0" clap = { version = "4.5.6", features = ["derive"] } @@ -58,8 +58,8 @@ smallvec = "1.13.2" strum = { version = "0.27.1", features = ["derive"] } sysinfo = { version = "0.34.2" } thiserror = "2.0.3" -vulkano = { git = "https://github.com/vulkano-rs/vulkano", rev = "94f50f1" } -vulkano-shaders = { git = "https://github.com/vulkano-rs/vulkano", rev = "94f50f1" } +vulkano = { version = "0.35.1" } +vulkano-shaders = { version = "0.35.0" } wlx-capture = { git = "https://github.com/galister/wlx-capture", tag = "v0.5.0", default-features = false } libmonado = { git = "https://github.com/technobaboo/libmonado-rs", rev = "256895b18c8f9368174fad8a6232ff07764eeacb", optional = true } winit = { version = "0.30.0", optional = true } diff --git a/src/graphics/mod.rs b/src/graphics/mod.rs index 896de78..6d6998b 100644 --- a/src/graphics/mod.rs +++ b/src/graphics/mod.rs @@ -17,28 +17,26 @@ use vulkano::{device::physical::PhysicalDeviceType, instance::InstanceCreateFlag #[cfg(feature = "openxr")] use {ash::vk, std::os::raw::c_void}; -pub type Vert2Buf = Subbuffer<[Vert2Uv]>; -pub type IndexBuf = Subbuffer<[u16]>; - use vulkano::{ buffer::{ allocator::{SubbufferAllocator, SubbufferAllocatorCreateInfo}, - Buffer, BufferContents, BufferCreateInfo, BufferUsage, Subbuffer, + Buffer, BufferContents, BufferCreateInfo, BufferUsage, IndexBuffer, Subbuffer, }, command_buffer::{ allocator::{StandardCommandBufferAllocator, StandardCommandBufferAllocatorCreateInfo}, - sys::{CommandBufferBeginInfo, RawRecordingCommandBuffer}, - CommandBuffer, CommandBufferExecFuture, CommandBufferInheritanceInfo, - CommandBufferInheritanceRenderPassType, CommandBufferInheritanceRenderingInfo, - CommandBufferLevel, CommandBufferUsage, CopyBufferToImageInfo, RecordingCommandBuffer, - RenderingAttachmentInfo, RenderingInfo, SubpassContents, + AutoCommandBufferBuilder, CommandBufferBeginInfo, CommandBufferExecFuture, + CommandBufferInheritanceInfo, CommandBufferInheritanceRenderPassType, + CommandBufferInheritanceRenderingInfo, CommandBufferLevel, CommandBufferUsage, + CopyBufferToImageInfo, PrimaryAutoCommandBuffer, PrimaryCommandBufferAbstract, + RecordingCommandBuffer, RenderingAttachmentInfo, RenderingInfo, SecondaryAutoCommandBuffer, + SubpassContents, }, descriptor_set::{ allocator::StandardDescriptorSetAllocator, DescriptorSet, WriteDescriptorSet, }, device::{ - physical::PhysicalDevice, Device, DeviceCreateInfo, DeviceExtensions, Features, Queue, - QueueCreateInfo, QueueFlags, + physical::PhysicalDevice, Device, DeviceCreateInfo, DeviceExtensions, DeviceFeatures, + Queue, QueueCreateInfo, QueueFlags, }, format::Format, image::{ @@ -86,6 +84,9 @@ use wlx_capture::frame::{ DRM_FORMAT_XBGR2101010, DRM_FORMAT_XBGR8888, DRM_FORMAT_XRGB8888, }; +pub type Vert2Buf = Subbuffer<[Vert2Uv]>; +pub type IndexBuf = IndexBuffer; + pub const DRM_FORMAT_MOD_INVALID: u64 = 0xff_ffff_ffff_ffff; #[repr(C)] @@ -162,7 +163,6 @@ impl WlxGraphics { ) -> anyhow::Result> { use std::ffi::{self, CString}; - use ash::vk::PhysicalDeviceDynamicRenderingFeatures; use vulkano::{ descriptor_set::allocator::StandardDescriptorSetAllocatorCreateInfo, Handle, Version, }; @@ -188,7 +188,7 @@ impl WlxGraphics { let target_version = vulkano::Version::V1_3; let library = get_vulkan_library(); - let vk_app_info_raw = vk::ApplicationInfo::builder() + let vk_app_info_raw = vk::ApplicationInfo::default() .application_version(0) .engine_version(0) .api_version(vk_target_version); @@ -199,7 +199,7 @@ impl WlxGraphics { system, get_instance_proc_addr, std::ptr::from_ref( - &vk::InstanceCreateInfo::builder() + &vk::InstanceCreateInfo::default() .application_info(&vk_app_info_raw) .enabled_extension_names(&instance_extensions_raw), ) @@ -279,25 +279,23 @@ impl WlxGraphics { }) .collect::>(); - let features = Features { + let features = DeviceFeatures { dynamic_rendering: true, ..Default::default() }; let queue_priorities = [1.0]; - let queue_create_infos = [vk::DeviceQueueCreateInfo::builder() + let queue_create_infos = [vk::DeviceQueueCreateInfo::default() .queue_family_index(queue_family_index) - .queue_priorities(&queue_priorities) - .build()]; + .queue_priorities(&queue_priorities)]; - let mut device_create_info = vk::DeviceCreateInfo::builder() + let mut device_create_info = vk::DeviceCreateInfo::default() .queue_create_infos(&queue_create_infos) - .enabled_extension_names(&device_extensions_raw) - .build(); + .enabled_extension_names(&device_extensions_raw); let mut dynamic_rendering = - PhysicalDeviceDynamicRenderingFeatures::builder().dynamic_rendering(true); + vk::PhysicalDeviceDynamicRenderingFeatures::default().dynamic_rendering(true); dynamic_rendering.p_next = device_create_info.p_next.cast_mut(); device_create_info.p_next = &raw mut dynamic_rendering as *const c_void; @@ -485,9 +483,9 @@ impl WlxGraphics { physical_device, DeviceCreateInfo { enabled_extensions: my_extensions, - enabled_features: Features { + enabled_features: DeviceFeatures { dynamic_rendering: true, - ..Features::empty() + ..DeviceFeatures::empty() }, queue_create_infos: vec![QueueCreateInfo { queue_family_index, @@ -630,9 +628,9 @@ impl WlxGraphics { physical_device, DeviceCreateInfo { enabled_extensions: my_extensions, - enabled_features: Features { + enabled_features: DeviceFeatures { dynamic_rendering: true, - ..Features::empty() + ..DeviceFeatures::empty() }, queue_create_infos: vec![QueueCreateInfo { queue_family_index, @@ -733,7 +731,7 @@ impl WlxGraphics { INDICES.iter().copied(), )?; - Ok((quad_verts, quad_indices)) + Ok((quad_verts, IndexBuffer::U16(quad_indices))) } pub fn upload_verts( @@ -944,15 +942,10 @@ impl WlxGraphics { self: &Arc, usage: CommandBufferUsage, ) -> anyhow::Result { - let command_buffer = RecordingCommandBuffer::new( + let command_buffer = AutoCommandBufferBuilder::primary( self.command_buffer_allocator.clone(), self.queue.queue_family_index(), - CommandBufferLevel::Primary, - CommandBufferBeginInfo { - usage, - inheritance_info: None, - ..Default::default() - }, + usage, )?; Ok(WlxCommandBuffer { graphics: self.clone(), @@ -978,7 +971,7 @@ impl WlxGraphics { }; let command_buffer = unsafe { - let mut builder = RawRecordingCommandBuffer::new( + let mut builder = RecordingCommandBuffer::new( self.command_buffer_allocator.clone(), self.queue.queue_family_index(), CommandBufferLevel::Primary, @@ -1006,10 +999,7 @@ impl WlxGraphics { (fns.v1_0.queue_submit)( self.queue.handle(), 1, - [SubmitInfo::builder() - .command_buffers(&[command_buffer.handle()]) - .build()] - .as_ptr(), + [SubmitInfo::default().command_buffers(&[command_buffer.handle()])].as_ptr(), fence.handle(), ) } @@ -1021,7 +1011,7 @@ impl WlxGraphics { pub struct WlxCommandBuffer { pub graphics: Arc, - pub command_buffer: RecordingCommandBuffer, + pub command_buffer: AutoCommandBufferBuilder, } impl WlxCommandBuffer { @@ -1097,8 +1087,8 @@ impl WlxCommandBuffer { Ok(()) } - pub fn build(self) -> anyhow::Result> { - Ok(self.command_buffer.end()?) + pub fn build(self) -> anyhow::Result> { + Ok(self.command_buffer.build()?) } pub fn build_and_execute(self) -> anyhow::Result> { @@ -1131,7 +1121,7 @@ impl WlxPipeline { let vep = vert.entry_point("main").unwrap(); // want panic let fep = frag.entry_point("main").unwrap(); // want panic - let vertex_input_state = Vert2Uv::per_vertex().definition(&vep.info().input_interface)?; + let vertex_input_state = Vert2Uv::per_vertex().definition(&vep)?; let stages = smallvec![ vulkano::pipeline::PipelineShaderStageCreateInfo::new(vep), @@ -1272,7 +1262,7 @@ impl WlxPipeline { } pub struct WlxPass { - pub command_buffer: Arc, + pub command_buffer: Arc, } impl WlxPass { @@ -1289,21 +1279,18 @@ impl WlxPass { depth_range: 0.0..=1.0, }; let pipeline_inner = pipeline.inner(); - let mut command_buffer = RecordingCommandBuffer::new( + let mut command_buffer = AutoCommandBufferBuilder::secondary( pipeline.graphics.command_buffer_allocator.clone(), pipeline.graphics.queue.queue_family_index(), - CommandBufferLevel::Secondary, - CommandBufferBeginInfo { - usage: CommandBufferUsage::MultipleSubmit, - inheritance_info: Some(CommandBufferInheritanceInfo { - render_pass: Some(CommandBufferInheritanceRenderPassType::BeginRendering( - CommandBufferInheritanceRenderingInfo { - color_attachment_formats: vec![Some(pipeline.format)], - ..Default::default() - }, - )), - ..Default::default() - }), + CommandBufferUsage::MultipleSubmit, + CommandBufferInheritanceInfo { + render_pass: Some(CommandBufferInheritanceRenderPassType::BeginRendering( + CommandBufferInheritanceRenderingInfo { + color_attachment_formats: vec![Some(pipeline.format)], + + ..Default::default() + }, + )), ..Default::default() }, )?; @@ -1324,18 +1311,18 @@ impl WlxPass { }; Ok(Self { - command_buffer: command_buffer.end()?, + command_buffer: command_buffer.build()?, }) } } #[derive(Default)] pub struct CommandBuffers { - inner: Vec>, + inner: Vec>, } impl CommandBuffers { - pub fn push(&mut self, buffer: Arc) { + pub fn push(&mut self, buffer: Arc) { self.inner.push(buffer); } pub fn execute_now(self, queue: Arc) -> anyhow::Result>> {