2023-01-16 23:09:07 -05:00
|
|
|
//! 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.
|
|
|
|
|
2022-12-06 01:01:21 -05:00
|
|
|
#![feature(type_alias_impl_trait)]
|
2022-12-06 01:38:21 -05:00
|
|
|
#![feature(let_chains)]
|
2022-12-25 01:18:11 -05:00
|
|
|
#![feature(strict_provenance)]
|
2022-12-05 21:01:15 -05:00
|
|
|
|
2022-12-21 21:39:31 -05:00
|
|
|
mod draw_quad;
|
2022-12-06 01:01:21 -05:00
|
|
|
mod filter_chain;
|
|
|
|
mod filter_pass;
|
2022-12-07 02:05:10 -05:00
|
|
|
mod framebuffer;
|
2023-02-08 21:21:40 -05:00
|
|
|
mod graphics_pipeline;
|
2023-01-13 01:19:41 -05:00
|
|
|
#[cfg(test)]
|
2023-01-09 22:54:54 -05:00
|
|
|
mod hello_triangle;
|
2022-12-21 21:39:31 -05:00
|
|
|
mod luts;
|
2023-01-13 01:48:04 -05:00
|
|
|
mod parameters;
|
|
|
|
mod queue_selection;
|
2022-12-21 22:03:38 -05:00
|
|
|
mod samplers;
|
2022-12-22 01:30:14 -05:00
|
|
|
mod texture;
|
2023-01-09 22:54:54 -05:00
|
|
|
mod util;
|
|
|
|
mod vulkan_primitives;
|
2023-01-13 01:19:41 -05:00
|
|
|
|
2023-01-13 16:55:50 -05:00
|
|
|
pub use filter_chain::FilterChainVulkan;
|
2023-01-13 02:32:21 -05:00
|
|
|
pub use filter_chain::VulkanInstance;
|
2023-01-15 03:06:09 -05:00
|
|
|
pub use filter_chain::VulkanObjects;
|
2023-01-13 01:48:04 -05:00
|
|
|
pub use texture::VulkanImage;
|
2023-01-13 01:19:41 -05:00
|
|
|
|
|
|
|
pub mod error;
|
|
|
|
pub mod options;
|
2023-01-25 23:45:10 -05:00
|
|
|
mod render_pass;
|
2022-12-05 21:01:15 -05:00
|
|
|
|
|
|
|
#[cfg(test)]
|
|
|
|
mod tests {
|
2023-01-13 16:55:50 -05:00
|
|
|
use crate::filter_chain::FilterChainVulkan;
|
2023-01-03 00:55:35 -05:00
|
|
|
use crate::hello_triangle::vulkan_base::VulkanBase;
|
2023-01-25 23:45:10 -05:00
|
|
|
use crate::options::FilterChainOptionsVulkan;
|
2023-01-03 00:55:35 -05:00
|
|
|
|
2022-12-05 21:01:15 -05:00
|
|
|
#[test]
|
|
|
|
fn triangle_vk() {
|
2023-01-09 22:54:54 -05:00
|
|
|
let entry = unsafe { ash::Entry::load().unwrap() };
|
2023-01-03 00:55:35 -05:00
|
|
|
let base = VulkanBase::new(entry).unwrap();
|
2023-01-15 11:08:13 -05:00
|
|
|
let filter = FilterChainVulkan::load_from_path(
|
2023-01-03 00:55:35 -05:00
|
|
|
&base,
|
2023-02-07 23:08:44 -05:00
|
|
|
// "../test/slang-shaders/crt/crt-royale.slangp",
|
|
|
|
"../test/slang-shaders/bezel/Mega_Bezel/Presets/MBZ__2__ADV-NO-REFLECT.slangp",
|
2023-01-13 00:07:03 -05:00
|
|
|
// "../test/basic.slangp",
|
2023-01-25 23:45:10 -05:00
|
|
|
Some(&FilterChainOptionsVulkan {
|
|
|
|
frames_in_flight: 3,
|
|
|
|
force_no_mipmaps: false,
|
2023-02-08 21:21:40 -05:00
|
|
|
use_render_pass: true,
|
2023-01-25 23:45:10 -05:00
|
|
|
}),
|
2023-01-09 22:54:54 -05:00
|
|
|
)
|
|
|
|
.unwrap();
|
2023-01-03 00:55:35 -05:00
|
|
|
|
|
|
|
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
|
|
|
|
// // )
|
|
|
|
//
|
2022-12-21 21:13:35 -05:00
|
|
|
// let mut filter = FilterChainVulkan::load_from_path(
|
2023-01-03 00:55:35 -05:00
|
|
|
// (
|
|
|
|
// base.device.clone(),
|
|
|
|
// base.present_queue.clone(),
|
|
|
|
// base.device_memory_properties.clone(),
|
|
|
|
// ),
|
2022-12-21 21:13:35 -05:00
|
|
|
// "../test/slang-shaders/border/gameboy-player/gameboy-player-crt-royale.slangp",
|
2023-01-03 00:55:35 -05:00
|
|
|
// None,
|
2022-12-21 21:13:35 -05:00
|
|
|
// )
|
2023-01-03 00:55:35 -05:00
|
|
|
// // FilterChain::load_from_path("../test/slang-shaders/bezel/Mega_Bezel/Presets/MBZ__0__SMOOTH-ADV.slangp", None)
|
|
|
|
// .unwrap();
|
|
|
|
// hello_triangle_old::main(base, filter);
|
2022-12-05 21:01:15 -05:00
|
|
|
}
|
|
|
|
}
|