From 41ded3215696a28999d40a68f5d1bf500300bd0e Mon Sep 17 00:00:00 2001 From: Rua Date: Mon, 6 Mar 2023 03:12:17 +0100 Subject: [PATCH] Update dependencies, clippy warnings (#2142) * Update dependencies, clippy warnings * Remove allowed clippy lint that no longer triggers as of Rust 1.67.1 --- examples/Cargo.toml | 2 +- vulkano-shaders/src/lib.rs | 5 +- vulkano-util/Cargo.toml | 2 +- vulkano-win/Cargo.toml | 2 +- vulkano-win/src/winit.rs | 2 +- vulkano/Cargo.toml | 11 +- vulkano/macros/Cargo.toml | 5 +- vulkano/src/command_buffer/synced/builder.rs | 2 +- vulkano/src/lib.rs | 1 + vulkano/vk.xml | 442 +++++++++++++------ 10 files changed, 311 insertions(+), 163 deletions(-) diff --git a/examples/Cargo.toml b/examples/Cargo.toml index c867b717..4a026e6f 100644 --- a/examples/Cargo.toml +++ b/examples/Cargo.toml @@ -12,7 +12,7 @@ vulkano = { path = "../vulkano", features = ["serde"] } vulkano-shaders = { path = "../vulkano-shaders" } # The Vulkan library doesn't provide any functionality to create and handle windows, as # this would be out of scope. In order to open a window, we are going to use the `winit` crate. -winit = "0.27" +winit = "0.28" # The `vulkano_win` crate is the link between `vulkano` and `winit`. Vulkano doesn't know about winit, # and winit doesn't know about vulkano, so import a crate that will provide a link between the two. vulkano-win = { path = "../vulkano-win" } diff --git a/vulkano-shaders/src/lib.rs b/vulkano-shaders/src/lib.rs index b93515ab..d85111ff 100644 --- a/vulkano-shaders/src/lib.rs +++ b/vulkano-shaders/src/lib.rs @@ -210,6 +210,7 @@ #![doc(html_logo_url = "https://raw.githubusercontent.com/vulkano-rs/vulkano/master/logo.png")] #![recursion_limit = "1024"] +#![allow(clippy::needless_borrowed_reference)] #![warn(rust_2018_idioms, rust_2021_compatibility)] #[macro_use] @@ -391,9 +392,9 @@ impl Parse for MacroInput { let mut linalg_type = None; let mut dump = None; - fn parse_shader_fields<'k>( + fn parse_shader_fields( output: &mut (Option, Option), - name: &'k str, + name: &str, input: ParseStream<'_>, ) -> Result<()> { match name { diff --git a/vulkano-util/Cargo.toml b/vulkano-util/Cargo.toml index 8b97c0b8..a9bed16f 100644 --- a/vulkano-util/Cargo.toml +++ b/vulkano-util/Cargo.toml @@ -15,4 +15,4 @@ categories = ["rendering::graphics-api"] ahash = "0.8" vulkano = { version = "0.32.0", path = "../vulkano" } vulkano-win = { version = "0.32.0", path = "../vulkano-win" } -winit = { version = "0.27" } +winit = { version = "0.28" } diff --git a/vulkano-win/Cargo.toml b/vulkano-win/Cargo.toml index 0c59d1bf..dd163feb 100644 --- a/vulkano-win/Cargo.toml +++ b/vulkano-win/Cargo.toml @@ -19,7 +19,7 @@ raw-window-handle_ = ["raw-window-handle"] [dependencies] raw-window-handle = { version = "0.5", optional = true } vulkano = { version = "0.32.0", path = "../vulkano" } -winit = { version = "0.27", optional = true } +winit = { version = "0.28", optional = true } [target.'cfg(any(target_os = "macos", target_os = "ios"))'.dependencies] objc = { version = "0.2.5", optional = true } diff --git a/vulkano-win/src/winit.rs b/vulkano-win/src/winit.rs index 653c3020..d3770635 100644 --- a/vulkano-win/src/winit.rs +++ b/vulkano-win/src/winit.rs @@ -128,7 +128,7 @@ unsafe fn winit_to_surface( instance: Arc, window: Arc, ) -> Result, SurfaceCreationError> { - use winit::platform::unix::WindowExtUnix; + use winit::platform::{wayland::WindowExtWayland, x11::WindowExtX11}; match (window.wayland_display(), window.wayland_surface()) { (Some(display), Some(surface)) => { diff --git a/vulkano/Cargo.toml b/vulkano/Cargo.toml index 086a56f6..f99489de 100644 --- a/vulkano/Cargo.toml +++ b/vulkano/Cargo.toml @@ -2,10 +2,7 @@ name = "vulkano" version = "0.32.0" edition = "2021" -authors = [ - "Pierre Krieger ", - "The vulkano contributors", -] +authors = ["Pierre Krieger ", "The vulkano contributors"] repository = "https://github.com/vulkano-rs/vulkano" description = "Safe wrapper for the Vulkan graphics API" license = "MIT/Apache-2.0" @@ -20,14 +17,14 @@ build = "build.rs" ahash = "0.8" # When updating Ash, also update vk.xml to the same Vulkan patch version that Ash uses. # All versions of vk.xml can be found at https://github.com/KhronosGroup/Vulkan-Headers/commits/main/registry/vk.xml. -ash = "^0.37.1" +ash = "^0.37.2" bytemuck = "1.7" cgmath = { version = "0.18.0", optional = true } crossbeam-queue = "0.3" half = { version = "2", features = ["bytemuck"] } libloading = "0.7" -nalgebra = { version = "0.31.0", optional = true } -once_cell = "1.16" +nalgebra = { version = "0.32.0", optional = true } +once_cell = "1.17" parking_lot = { version = "0.12", features = ["send_guard"] } serde = { version = "1.0", optional = true } smallvec = "1.8" diff --git a/vulkano/macros/Cargo.toml b/vulkano/macros/Cargo.toml index 9125ddc4..89c5ce8b 100644 --- a/vulkano/macros/Cargo.toml +++ b/vulkano/macros/Cargo.toml @@ -2,10 +2,7 @@ name = "vulkano-macros" version = "0.32.0" edition = "2021" -authors = [ - "Pierre Krieger ", - "The vulkano contributors", -] +authors = ["Pierre Krieger ", "The vulkano contributors"] repository = "https://github.com/vulkano-rs/vulkano" description = "Macros used by Vulkano" license = "MIT/Apache-2.0" diff --git a/vulkano/src/command_buffer/synced/builder.rs b/vulkano/src/command_buffer/synced/builder.rs index 7336bcc7..4ad60291 100644 --- a/vulkano/src/command_buffer/synced/builder.rs +++ b/vulkano/src/command_buffer/synced/builder.rs @@ -1306,7 +1306,7 @@ impl<'a> CommandBufferBuilderState<'a> { /// Returns whether depth bound testing is enabled, or `None` if nothing has been set yet. #[inline] pub fn depth_bounds_test_enable(&self) -> Option { - self.current_state.depth_bias_enable + self.current_state.depth_bounds_test_enable } /// Returns the current depth compare op, or `None` if nothing has been set yet. diff --git a/vulkano/src/lib.rs b/vulkano/src/lib.rs index a35e8d77..b3e9d1cb 100644 --- a/vulkano/src/lib.rs +++ b/vulkano/src/lib.rs @@ -143,6 +143,7 @@ clippy::missing_safety_doc, // TODO: remove clippy::module_inception, clippy::mutable_key_type, + clippy::needless_borrowed_reference, clippy::new_without_default, clippy::nonminimal_bool, clippy::op_ref, // Seems to be bugged, the fixed code triggers a compile error diff --git a/vulkano/vk.xml b/vulkano/vk.xml index f961463b..ca2ca438 100644 --- a/vulkano/vk.xml +++ b/vulkano/vk.xml @@ -159,7 +159,7 @@ branch of the member gitlab server. // Vulkan 1.3 version number #define VK_API_VERSION_1_3 VK_MAKE_API_VERSION(0, 1, 3, 0)// Patch version should always be set to 0 // Version of this file -#define VK_HEADER_VERSION 235 +#define VK_HEADER_VERSION 238 // Complete version of this file #define VK_HEADER_VERSION_COMPLETE VK_MAKE_API_VERSION(0, 1, 3, VK_HEADER_VERSION) @@ -355,7 +355,7 @@ typedef void* MTLSharedEvent_id; typedef VkFlags VkBuildMicromapFlagsEXT; typedef VkFlags VkMicromapCreateFlagsEXT; - + typedef VkFlags VkDirectDriverLoadingFlagsLUNARG; WSI extensions typedef VkFlags VkCompositeAlphaFlagsKHR; @@ -441,6 +441,8 @@ typedef void* MTLSharedEvent_id; typedef VkFlags VkOpticalFlowUsageFlagsNV; typedef VkFlags VkOpticalFlowSessionCreateFlagsNV; typedef VkFlags VkOpticalFlowExecuteFlagsNV; + typedef VkFlags VkPresentScalingFlagsEXT; + typedef VkFlags VkPresentGravityFlagsEXT; Video Core extension typedef VkFlags VkVideoCodecOperationFlagsKHR; @@ -457,7 +459,7 @@ typedef void* MTLSharedEvent_id; typedef VkFlags VkVideoDecodeFlagsKHR; Video Decode H.264 extension - typedef VkFlags VkVideoDecodeH264PictureLayoutFlagsEXT; + typedef VkFlags VkVideoDecodeH264PictureLayoutFlagsKHR; Video Encode Core extension typedef VkFlags VkVideoEncodeFlagsKHR; @@ -529,7 +531,7 @@ typedef void* MTLSharedEvent_id; VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkDisplayKHR) VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkDisplayModeKHR) VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkSurfaceKHR) - VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkSwapchainKHR) + VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkSwapchainKHR) VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkDebugReportCallbackEXT) VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkDebugUtilsMessengerEXT) @@ -724,6 +726,7 @@ typedef void* MTLSharedEvent_id; + WSI extensions @@ -795,6 +798,8 @@ typedef void* MTLSharedEvent_id; + + Enumerated types in the header, but not used by the API @@ -818,7 +823,7 @@ typedef void* MTLSharedEvent_id; Video H.264 Decode extensions - + Video H.265 Decode extensions @@ -895,6 +900,15 @@ typedef void* MTLSharedEvent_id; const VkDeviceMemoryReportCallbackDataEXT* pCallbackData, void* pUserData); + The PFN_vkGetInstanceProcAddrLUNARG type is used by the + VkDirectDriverLoadingInfoLUNARG structure. + We cannot introduce an explicit dependency on the + equivalent PFN_vkGetInstanceProcAddr type, even though + it is implicitly generated in the C header, because + that results in multiple definitions. + typedef PFN_vkVoidFunction (VKAPI_PTR *PFN_vkGetInstanceProcAddrLUNARG)( + VkInstance instance, const char* pName); + Struct types VkStructureType sType @@ -1191,7 +1205,7 @@ typedef void* MTLSharedEvent_id; const uint32_t* pQueueFamilyIndicesArray of queue family indices to share across VkImageLayout initialLayoutInitial image layout for all subresources - + VkDeviceSize offsetSpecified in bytes VkDeviceSize sizeSpecified in bytes VkDeviceSize rowPitchSpecified in bytes @@ -6063,7 +6077,7 @@ typedef void* MTLSharedEvent_id; const VkVideoProfileInfoKHR* pProfiles - VkStructureType sType + VkStructureType sType const void* pNext VkImageUsageFlags imageUsage @@ -6173,44 +6187,44 @@ typedef void* MTLSharedEvent_id; - - VkStructureType sType + + VkStructureType sType const void* pNext StdVideoH264ProfileIdc stdProfileIdc - VkVideoDecodeH264PictureLayoutFlagBitsEXT pictureLayout + VkVideoDecodeH264PictureLayoutFlagBitsKHR pictureLayout - - VkStructureType sType + + VkStructureType sType void* pNext StdVideoH264LevelIdc maxLevelIdc VkOffset2D fieldOffsetGranularity - - VkStructureType sType + + VkStructureType sType const void* pNext uint32_t stdSPSCount const StdVideoH264SequenceParameterSet* pStdSPSs uint32_t stdPPSCount const StdVideoH264PictureParameterSet* pStdPPSsList of Picture Parameters associated with the spsStd, above - - VkStructureType sType + + VkStructureType sType const void* pNext uint32_t maxStdSPSCount uint32_t maxStdPPSCount - const VkVideoDecodeH264SessionParametersAddInfoEXT* pParametersAddInfo + const VkVideoDecodeH264SessionParametersAddInfoKHR* pParametersAddInfo - - VkStructureType sType + + VkStructureType sType const void* pNext const StdVideoDecodeH264PictureInfo* pStdPictureInfo uint32_t sliceCount const uint32_t* pSliceOffsets - - VkStructureType sType + + VkStructureType sType const void* pNext const StdVideoDecodeH264ReferenceInfo* pStdReferenceInfo @@ -6238,18 +6252,18 @@ typedef void* MTLSharedEvent_id; - - VkStructureType sType + + VkStructureType sType const void* pNext StdVideoH265ProfileIdc stdProfileIdc - - VkStructureType sType + + VkStructureType sType void* pNext StdVideoH265LevelIdc maxLevelIdc - - VkStructureType sType + + VkStructureType sType const void* pNext uint32_t stdVPSCount const StdVideoH265VideoParameterSet* pStdVPSs @@ -6258,23 +6272,23 @@ typedef void* MTLSharedEvent_id; uint32_t stdPPSCount const StdVideoH265PictureParameterSet* pStdPPSsList of Picture Parameters associated with the spsStd, above - - VkStructureType sType + + VkStructureType sType const void* pNext uint32_t maxStdVPSCount uint32_t maxStdSPSCount uint32_t maxStdPPSCount - const VkVideoDecodeH265SessionParametersAddInfoEXT* pParametersAddInfo + const VkVideoDecodeH265SessionParametersAddInfoKHR* pParametersAddInfo - - VkStructureType sType + + VkStructureType sType const void* pNext StdVideoDecodeH265PictureInfo* pStdPictureInfo - uint32_t sliceCount - const uint32_t* pSliceOffsets + uint32_t sliceSegmentCount + const uint32_t* pSliceSegmentOffsets - - VkStructureType sType + + VkStructureType sType const void* pNext const StdVideoDecodeH265ReferenceInfo* pStdReferenceInfo @@ -6754,7 +6768,7 @@ typedef void* MTLSharedEvent_id; const VkDescriptorAddressInfoEXT* pStorageTexelBuffer const VkDescriptorAddressInfoEXT* pUniformBuffer const VkDescriptorAddressInfoEXT* pStorageBuffer - VkDeviceAddress accelerationStructure + VkDeviceAddress accelerationStructure VkStructureType sType @@ -7650,7 +7664,64 @@ typedef void* MTLSharedEvent_id; void* pNext VkBool32 shaderCoreBuiltins - + + VkStructureType sType + void* pNext + VkPresentModeKHR presentMode + + + VkStructureType sType + void* pNext + VkPresentScalingFlagsEXT supportedPresentScaling + VkPresentGravityFlagsEXT supportedPresentGravityX + VkPresentGravityFlagsEXT supportedPresentGravityY + VkExtent2D minScaledImageExtentSupported minimum image width and height for the surface when scaling is used + VkExtent2D maxScaledImageExtentSupported maximum image width and height for the surface when scaling is used + + + VkStructureType sType + void* pNext + uint32_t presentModeCount + VkPresentModeKHR* pPresentModesOutput list of present modes compatible with the one specified in VkSurfacePresentModeEXT + + + VkStructureType sType + void* pNext + VkBool32 swapchainMaintenance1 + + + VkStructureType sType + void* pNext + uint32_t swapchainCountCopy of VkPresentInfoKHR::swapchainCount + const VkFence* pFencesFence to signal for each swapchain + + + VkStructureType sType + void* pNext + uint32_t presentModeCountLength of the pPresentModes array + const VkPresentModeKHR* pPresentModesPresentation modes which will be usable with this swapchain + + + VkStructureType sType + void* pNext + uint32_t swapchainCountCopy of VkPresentInfoKHR::swapchainCount + const VkPresentModeKHR* pPresentModesPresentation mode for each swapchain + + + VkStructureType sType + const void* pNext + VkPresentScalingFlagsEXT scalingBehavior + VkPresentGravityFlagsEXT presentGravityX + VkPresentGravityFlagsEXT presentGravityY + + + VkStructureType sType + const void* pNext + VkSwapchainKHR swapchainSwapchain for which images are being released + uint32_t imageIndexCountNumber of indices to release + const uint32_t* pImageIndicesIndices of which presentable images to release + + VkStructureType sType void* pNext VkBool32 rayTracingInvocationReorder @@ -7660,6 +7731,24 @@ typedef void* MTLSharedEvent_id; void* pNext VkRayTracingInvocationReorderModeNV rayTracingInvocationReorderReorderingHint + + VkStructureType sType + void* pNext + VkDirectDriverLoadingFlagsLUNARG flags + PFN_vkGetInstanceProcAddrLUNARG pfnGetInstanceProcAddr + + + VkStructureType sType + void* pNext + VkDirectDriverLoadingModeLUNARG mode + uint32_t driverCount + const VkDirectDriverLoadingInfoLUNARG* pDrivers + + + VkStructureType sType + void* pNext + VkBool32 multiviewPerViewViewports + @@ -8242,6 +8331,10 @@ typedef void* MTLSharedEvent_id; + + + + Flags @@ -9263,6 +9356,16 @@ typedef void* MTLSharedEvent_id; + + + + + + + + + + @@ -9287,10 +9390,10 @@ typedef void* MTLSharedEvent_id; - - - - + + + + @@ -10614,14 +10717,14 @@ typedef void* MTLSharedEvent_id; void vkCmdEndConditionalRenderingEXT VkCommandBuffer commandBuffer - + void vkCmdResetQueryPool VkCommandBuffer commandBuffer VkQueryPool queryPool uint32_t firstQuery uint32_t queryCount - + void vkCmdWriteTimestamp VkCommandBuffer commandBuffer VkPipelineStageFlagBits pipelineStage @@ -12858,14 +12961,14 @@ typedef void* MTLSharedEvent_id; VkVideoSessionKHR videoSession const VkAllocationCallbacks* pAllocator - + VkResult vkCreateVideoSessionParametersKHR VkDevice device const VkVideoSessionParametersCreateInfoKHR* pCreateInfo const VkAllocationCallbacks* pAllocator VkVideoSessionParametersKHR* pVideoSessionParameters - + VkResult vkUpdateVideoSessionParametersKHR VkDevice device VkVideoSessionParametersKHR videoSessionParameters @@ -12877,14 +12980,14 @@ typedef void* MTLSharedEvent_id; VkVideoSessionParametersKHR videoSessionParameters const VkAllocationCallbacks* pAllocator - + VkResult vkGetVideoSessionMemoryRequirementsKHR VkDevice device VkVideoSessionKHR videoSession uint32_t* pMemoryRequirementsCount VkVideoSessionMemoryRequirementsKHR* pMemoryRequirements - + VkResult vkBindVideoSessionMemoryKHR VkDevice device VkVideoSessionKHR videoSession @@ -13288,6 +13391,11 @@ typedef void* MTLSharedEvent_id; VkDeviceFaultCountsEXT* pFaultCounts VkDeviceFaultInfoEXT* pFaultInfo + + VkResult vkReleaseSwapchainImagesEXT + VkDevice device + const VkReleaseSwapchainImagesInfoEXT* pReleaseInfo + @@ -14898,40 +15006,40 @@ typedef void* MTLSharedEvent_id; - + - + - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + - - + + - - + + - - - - - - + + + + + + @@ -14987,28 +15095,28 @@ typedef void* MTLSharedEvent_id; - + - + - - - - + + + + - - - - - - - - - - - - - + + + + + + + + + + + + + @@ -15024,8 +15132,8 @@ typedef void* MTLSharedEvent_id; - - + + @@ -15247,25 +15355,25 @@ typedef void* MTLSharedEvent_id; - + - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + @@ -17368,25 +17476,25 @@ typedef void* MTLSharedEvent_id; - + - - - - - - - - - + + + + + + + + + - - + + - - - - + + + + @@ -18349,16 +18457,40 @@ typedef void* MTLSharedEvent_id; - + - - + + + + + + + + + + + + - + - - + + + + + + + + + + + + + + + + @@ -20296,7 +20428,6 @@ typedef void* MTLSharedEvent_id; - @@ -20444,10 +20575,17 @@ typedef void* MTLSharedEvent_id; - + - - + + + + + + + + + @@ -20706,10 +20844,12 @@ typedef void* MTLSharedEvent_id; - + - - + + + + @@ -20819,6 +20959,18 @@ typedef void* MTLSharedEvent_id; + + + + + + + + + + + +