From 34b50059caf3c5083590c2dbd776fdd740fa2d9d Mon Sep 17 00:00:00 2001 From: chyyran Date: Mon, 30 Sep 2024 02:34:41 -0400 Subject: [PATCH] doc(d3d12,vk): clear up language for barriers also remove useless `libra_PFN_vkGetInstanceProcAddr` --- Cargo.lock | 55 +++++++++++-------- include/librashader.h | 4 +- .../src/runtime/d3d12/filter_chain.rs | 2 +- .../src/runtime/vk/filter_chain.rs | 10 ++-- 4 files changed, 39 insertions(+), 32 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index fcf7600..1c4a942 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -474,9 +474,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.1.22" +version = "1.1.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9540e661f81799159abee814118cc139a2004b3a3aa3ea37724a1b66530b90e0" +checksum = "3bbb537bb4a30b90362caddba8f360c0a56bc13d3a5570028e7197204cb54a17" dependencies = [ "jobserver", "libc", @@ -1145,9 +1145,9 @@ dependencies = [ [[package]] name = "glslang" -version = "0.5.2" +version = "0.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68ea691c064fdb88b4a329c240f76ed9ff21a9bde51f534e35106f97e95c7188" +checksum = "6e058f69c0b36dc2ce7e5243f440d186ae65ab7aa9e76cd4c5b953ea4b43286d" dependencies = [ "bitflags 2.6.0", "glslang-sys", @@ -1158,9 +1158,9 @@ dependencies = [ [[package]] name = "glslang-sys" -version = "0.5.2+fa9c3de" +version = "0.6.1+46ef757" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca4ade0a93e3a8597c8fd1e1df6a22c847803819401b39835fffb96a5b5ee06f" +checksum = "ad4a20351d34b8185981fe9e00c2934f061b59f54705dc497e7ae9cbecec0a07" dependencies = [ "cc", "glob", @@ -2275,9 +2275,12 @@ dependencies = [ [[package]] name = "once_cell" -version = "1.19.0" +version = "1.20.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" +checksum = "82881c4be219ab5faaf2ad5e5e5ecdff8c66bd7402ca3160975c93b24961afd1" +dependencies = [ + "portable-atomic", +] [[package]] name = "orbclient" @@ -2334,7 +2337,7 @@ checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" dependencies = [ "cfg-if", "libc", - "redox_syscall 0.5.6", + "redox_syscall 0.5.7", "smallvec", "windows-targets 0.52.6", ] @@ -2483,6 +2486,12 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "22686f4785f02a4fcc856d3b3bb19bf6c8160d103f7a99cc258bddd0251dc7f2" +[[package]] +name = "portable-atomic" +version = "1.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cc9c68a3f6da06753e9335d63e27f6b9754dd1920d941135b7ea8224f141adb2" + [[package]] name = "pp-rs" version = "0.2.1" @@ -2655,9 +2664,9 @@ dependencies = [ [[package]] name = "redox_syscall" -version = "0.5.6" +version = "0.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "355ae415ccd3a04315d3f8246e86d67689ea74d88d915576e1589a351062a13b" +checksum = "9b6dfecf2c74bce2466cabf93f6664d6998a69eb21e39f4207930065b27b771f" dependencies = [ "bitflags 2.6.0", ] @@ -2675,9 +2684,9 @@ dependencies = [ [[package]] name = "regex" -version = "1.10.6" +version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4219d74c6b67a3654a9fbebc4b419e22126d13d2f3c4a07ee0cb61ff79a79619" +checksum = "38200e5ee88914975b69f657f0801b6f6dccafd44fd9326302a4aaeecfacb1d8" dependencies = [ "aho-corasick", "memchr", @@ -2687,9 +2696,9 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.4.7" +version = "0.4.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38caf58cc5ef2fed281f89292ef23f6365465ed9a41b7a7754eb4e26496c92df" +checksum = "368758f23274712b504848e9d5a6f010445cc8b87a7cdb4d7cbee666c1288da3" dependencies = [ "aho-corasick", "memchr", @@ -2698,9 +2707,9 @@ dependencies = [ [[package]] name = "regex-syntax" -version = "0.8.4" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a66a03ae7c801facd77a29370b4faec201768915ac14a721ba36f20bc9c209b" +checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" [[package]] name = "renderdoc-sys" @@ -2974,9 +2983,9 @@ dependencies = [ [[package]] name = "spirv-cross2" -version = "0.4.4" +version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c5d14dec73c90ee9b2bbe23ca7e0964bd12033fccf362c67eb31f8fdb24b647" +checksum = "414b3818c6cc873baead8240dd4690052223c5bc982cb4093047a0b8fc839c45" dependencies = [ "bitflags 2.6.0", "bytemuck", @@ -3108,9 +3117,9 @@ checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" [[package]] name = "tempfile" -version = "3.12.0" +version = "3.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04cbcdd0c794ebb0d4cf35e88edd2f7d2c4c3e9a5a6dab322839b321c6a87a64" +checksum = "f0f2c9fc62d0beef6951ccffd757e241266a2c833136efbe35af6cd2567dca5b" dependencies = [ "cfg-if", "fastrand", @@ -3267,9 +3276,9 @@ checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" [[package]] name = "ucd-trie" -version = "0.1.6" +version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed646292ffc8188ef8ea4d1e0e0150fb15a5c2e12ad9b8fc191ae7a8a7f3c4b9" +checksum = "2896d95c02a80c6d6a5d6e953d479f5ddf2dfdb6a244441010e373ac0fb88971" [[package]] name = "unicode-ident" diff --git a/include/librashader.h b/include/librashader.h index 6107306..207f224 100644 --- a/include/librashader.h +++ b/include/librashader.h @@ -1386,7 +1386,7 @@ libra_error_t libra_vk_filter_chain_create_deferred(libra_shader_preset_t *prese /// Records rendering commands for a frame with the given parameters for the given filter chain /// to the input command buffer. /// -/// librashader **will not** create a pipeline barrier for the final pass. The output image must be +/// A pipeline barrier **will not** be created for the final pass. The output image must be /// in `VK_COLOR_ATTACHMENT_OPTIMAL`, and will remain so after all shader passes. The caller must transition /// the output image to the final layout. /// @@ -1782,7 +1782,7 @@ libra_error_t libra_d3d12_filter_chain_create_deferred(libra_shader_preset_t *pr /// Records rendering commands for a frame with the given parameters for the given filter chain /// to the input command list. /// -/// librashader **will not** create a resource barrier for the final pass. The output image will +/// A resource barrier **will not** be created for the final pass. The output image will /// remain in `D3D12_RESOURCE_STATE_RENDER_TARGET` after all shader passes. The caller must transition /// the output image to the final resource state. /// diff --git a/librashader-capi/src/runtime/d3d12/filter_chain.rs b/librashader-capi/src/runtime/d3d12/filter_chain.rs index c5ea0ab..5ca7d3f 100644 --- a/librashader-capi/src/runtime/d3d12/filter_chain.rs +++ b/librashader-capi/src/runtime/d3d12/filter_chain.rs @@ -229,7 +229,7 @@ extern_fn! { /// Records rendering commands for a frame with the given parameters for the given filter chain /// to the input command list. /// - /// librashader **will not** create a resource barrier for the final pass. The output image will + /// A resource barrier **will not** be created for the final pass. The output image will /// remain in `D3D12_RESOURCE_STATE_RENDER_TARGET` after all shader passes. The caller must transition /// the output image to the final resource state. /// diff --git a/librashader-capi/src/runtime/vk/filter_chain.rs b/librashader-capi/src/runtime/vk/filter_chain.rs index f809fb0..55705f0 100644 --- a/librashader-capi/src/runtime/vk/filter_chain.rs +++ b/librashader-capi/src/runtime/vk/filter_chain.rs @@ -7,7 +7,7 @@ use librashader::runtime::vk::{ FilterChain, FilterChainOptions, FrameOptions, VulkanImage, VulkanInstance, }; use std::ffi::CStr; -use std::ffi::{c_char, c_void}; +use std::ffi::c_char; use std::mem::MaybeUninit; use std::ptr::NonNull; use std::slice; @@ -18,11 +18,9 @@ use librashader::runtime::{Size, Viewport}; use crate::LIBRASHADER_API_VERSION; use ash::vk; use ash::vk::Handle; -pub use ash::vk::PFN_vkGetInstanceProcAddr; -/// A Vulkan instance function loader that the Vulkan filter chain needs to be initialized with. -pub type libra_PFN_vkGetInstanceProcAddr = - unsafe extern "system" fn(instance: *mut c_void, p_name: *const c_char); +/// A Vulkan instance function loader that the Vulkan filter chain needs to be initialized with. +pub use ash::vk::PFN_vkGetInstanceProcAddr; /// Vulkan parameters for an image. #[repr(C)] @@ -237,7 +235,7 @@ extern_fn! { /// Records rendering commands for a frame with the given parameters for the given filter chain /// to the input command buffer. /// - /// librashader **will not** create a pipeline barrier for the final pass. The output image must be + /// A pipeline barrier **will not** be created for the final pass. The output image must be /// in `VK_COLOR_ATTACHMENT_OPTIMAL`, and will remain so after all shader passes. The caller must transition /// the output image to the final layout. ///