librashader/librashader-runtime-vk/src/lib.rs
chyyran fb827b7c24 vk: reallow usage of render passes for environments where dynamic rendering is not available
This implementation is greatly simplified compared to the older implementation where framebuffers were attached to output targets. Instead, the graphics pipeline object will create new framebuffers on the fly. The suggestion is still to use dynamic rendering for best performance.
2023-01-25 23:45:10 -05:00

83 lines
2.6 KiB
Rust

//! librashader Vulkan runtime
//!
//! This crate should not be used directly.
//! See [`librashader::runtime::vk`](https://docs.rs/librashader/latest/librashader/runtime/vk/index.html) instead.
#![feature(type_alias_impl_trait)]
#![feature(let_chains)]
#![feature(strict_provenance)]
mod draw_quad;
mod filter_chain;
mod filter_pass;
mod framebuffer;
#[cfg(test)]
mod hello_triangle;
mod luts;
mod parameters;
mod queue_selection;
mod render_target;
mod samplers;
mod texture;
mod util;
mod vulkan_primitives;
mod vulkan_state;
pub use filter_chain::FilterChainVulkan;
pub use filter_chain::VulkanInstance;
pub use filter_chain::VulkanObjects;
pub use texture::VulkanImage;
pub mod error;
pub mod options;
mod render_pass;
#[cfg(test)]
mod tests {
use ash::vk;
use crate::filter_chain::FilterChainVulkan;
use crate::hello_triangle::vulkan_base::VulkanBase;
use crate::options::FilterChainOptionsVulkan;
#[test]
fn triangle_vk() {
let entry = unsafe { ash::Entry::load().unwrap() };
let base = VulkanBase::new(entry).unwrap();
dbg!("finished");
let filter = FilterChainVulkan::load_from_path(
&base,
// "../test/slang-shaders/border/gameboy-player/gameboy-player-crt-royale.slangp",
"../test/slang-shaders/bezel/Mega_Bezel/Presets/MBZ__0__SMOOTH-ADV.slangp",
// "../test/basic.slangp",
Some(&FilterChainOptionsVulkan {
frames_in_flight: 3,
force_no_mipmaps: false,
render_pass_format: vk::Format::R8G8B8A8_UNORM,
}),
)
.unwrap();
crate::hello_triangle::main(base, filter)
// let base = hello_triangle_old::ExampleBase::new(900, 600);
// // let mut filter = FilterChainVulkan::load_from_path(
// // (base.device.clone(), base.present_queue.clone(), base.device_memory_properties.clone()),
// // "../test/slang-shaders/border/gameboy-player/gameboy-player-crt-royale.slangp",
// // None
// // )
//
// let mut filter = FilterChainVulkan::load_from_path(
// (
// base.device.clone(),
// base.present_queue.clone(),
// base.device_memory_properties.clone(),
// ),
// "../test/slang-shaders/border/gameboy-player/gameboy-player-crt-royale.slangp",
// None,
// )
// // FilterChain::load_from_path("../test/slang-shaders/bezel/Mega_Bezel/Presets/MBZ__0__SMOOTH-ADV.slangp", None)
// .unwrap();
// hello_triangle_old::main(base, filter);
}
}