2022-11-19 17:55:49 +11:00
|
|
|
#![feature(strict_provenance)]
|
2022-11-20 17:09:05 +11:00
|
|
|
#![feature(type_alias_impl_trait)]
|
2022-12-01 09:21:32 +11:00
|
|
|
#![feature(let_chains)]
|
2022-11-19 17:55:49 +11:00
|
|
|
|
2022-11-20 10:48:54 +11:00
|
|
|
mod binding;
|
2022-11-20 14:09:01 +11:00
|
|
|
mod filter_chain;
|
2022-11-20 15:16:57 +11:00
|
|
|
mod filter_pass;
|
|
|
|
mod framebuffer;
|
2022-11-20 15:16:19 +11:00
|
|
|
mod render_target;
|
2022-11-20 15:16:57 +11:00
|
|
|
mod util;
|
2022-11-14 16:14:05 +11:00
|
|
|
|
2022-11-30 17:38:05 +11:00
|
|
|
mod gl;
|
2022-11-27 08:47:48 +11:00
|
|
|
mod samplers;
|
2022-11-30 16:39:42 +11:00
|
|
|
mod texture;
|
2022-11-27 08:47:48 +11:00
|
|
|
|
2022-11-30 16:39:42 +11:00
|
|
|
pub mod error;
|
2022-12-01 11:05:24 +11:00
|
|
|
pub mod options;
|
|
|
|
|
2022-12-22 13:39:31 +11:00
|
|
|
pub use crate::gl::Framebuffer;
|
2023-01-13 18:32:21 +11:00
|
|
|
pub use filter_chain::FilterChain;
|
2022-12-01 09:21:32 +11:00
|
|
|
pub use framebuffer::GLImage;
|
2022-11-22 17:56:39 +11:00
|
|
|
|
2022-11-09 17:11:25 +11:00
|
|
|
#[cfg(test)]
|
|
|
|
mod tests {
|
|
|
|
use super::*;
|
2023-01-13 18:32:21 +11:00
|
|
|
use crate::filter_chain::FilterChain;
|
|
|
|
use crate::options::FilterChainOptions;
|
2022-11-09 17:11:25 +11:00
|
|
|
|
2022-11-12 13:52:22 +11:00
|
|
|
#[test]
|
2022-11-22 17:56:39 +11:00
|
|
|
fn triangle_gl() {
|
2022-11-30 16:39:42 +11:00
|
|
|
let (glfw, window, events, shader, vao) = gl::gl3::hello_triangle::setup();
|
2023-01-13 18:32:21 +11:00
|
|
|
let mut filter = FilterChain::load_from_path(
|
2023-01-12 17:20:13 +11:00
|
|
|
"../test/slang-shaders/bezel/Mega_Bezel/Presets/MBZ__0__SMOOTH-ADV.slangp",
|
2023-01-13 18:32:21 +11:00
|
|
|
Some(&FilterChainOptions {
|
2022-12-01 09:21:32 +11:00
|
|
|
gl_version: 0,
|
|
|
|
use_dsa: false,
|
2023-01-12 10:25:31 +11:00
|
|
|
force_no_mipmaps: false,
|
2022-12-01 11:05:24 +11:00
|
|
|
}),
|
|
|
|
)
|
|
|
|
// FilterChain::load_from_path("../test/slang-shaders/bezel/Mega_Bezel/Presets/MBZ__0__SMOOTH-ADV.slangp", None)
|
|
|
|
.unwrap();
|
2022-11-30 16:39:42 +11:00
|
|
|
gl::gl3::hello_triangle::do_loop(glfw, window, events, shader, vao, &mut filter);
|
|
|
|
}
|
|
|
|
|
|
|
|
#[test]
|
|
|
|
fn triangle_gl46() {
|
|
|
|
let (glfw, window, events, shader, vao) = gl::gl46::hello_triangle::setup();
|
2023-01-13 18:32:21 +11:00
|
|
|
let mut filter = FilterChain::load_from_path(
|
2023-01-03 17:06:42 +11:00
|
|
|
// "../test/slang-shaders/vhs/VHSPro.slangp",
|
2023-01-12 17:20:13 +11:00
|
|
|
"../test/slang-shaders/bezel/Mega_Bezel/Presets/MBZ__0__SMOOTH-ADV.slangp",
|
2023-01-13 18:32:21 +11:00
|
|
|
Some(&FilterChainOptions {
|
2022-12-01 09:21:32 +11:00
|
|
|
gl_version: 0,
|
|
|
|
use_dsa: true,
|
2023-01-12 10:25:31 +11:00
|
|
|
force_no_mipmaps: false,
|
2022-12-01 11:05:24 +11:00
|
|
|
}),
|
|
|
|
)
|
|
|
|
// FilterChain::load_from_path("../test/slang-shaders/bezel/Mega_Bezel/Presets/MBZ__0__SMOOTH-ADV.slangp", None)
|
|
|
|
.unwrap();
|
2022-11-30 16:39:42 +11:00
|
|
|
gl::gl46::hello_triangle::do_loop(glfw, window, events, shader, vao, &mut filter);
|
2022-11-12 13:52:22 +11:00
|
|
|
}
|
2022-11-09 17:11:25 +11:00
|
|
|
}
|