librashader/librashader-runtime-gl/src/lib.rs

62 lines
1.8 KiB
Rust
Raw Normal View History

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