2023-02-16 16:39:36 +11:00
|
|
|
mod hello_triangle;
|
|
|
|
|
|
|
|
use librashader_runtime::image::{Image, UVDirection};
|
|
|
|
use librashader_runtime_d3d11::options::FilterChainOptionsD3D11;
|
|
|
|
|
|
|
|
// "../test/slang-shaders/scalefx/scalefx-9x.slangp",
|
|
|
|
// "../test/slang-shaders/bezel/koko-aio/monitor-bloom.slangp",
|
|
|
|
// "../test/slang-shaders/presets/crt-geom-ntsc-upscale-sharp.slangp",
|
|
|
|
// const FILTER_PATH: &str =
|
|
|
|
// "../test/slang-shaders/handheld/console-border/gbc-lcd-grid-v2.slangp";
|
|
|
|
// "../test/null.slangp",
|
2023-02-17 09:41:12 +11:00
|
|
|
// const FILTER_PATH: &str =
|
|
|
|
// "../test/Mega_Bezel_Packs/Duimon-Mega-Bezel/Presets/Advanced/Nintendo_GBA_SP/GBA_SP-[ADV]-[LCD-GRID].slangp";
|
|
|
|
|
2024-03-08 12:15:16 +11:00
|
|
|
const FILTER_PATH: &str = "../test/shaders_slang/crt/crt-royale.slangp";
|
2023-02-16 16:39:36 +11:00
|
|
|
|
|
|
|
// const FILTER_PATH: &str = "../test/slang-shaders/test/history.slangp";
|
|
|
|
// const FILTER_PATH: &str = "../test/slang-shaders/test/feedback.slangp";
|
|
|
|
|
2024-02-22 16:41:29 +11:00
|
|
|
// const FILTER_PATH: &str = "../test/shaders_slang/crt/crt-royale.slangp";
|
2023-02-16 16:39:36 +11:00
|
|
|
const IMAGE_PATH: &str = "../triangle.png";
|
|
|
|
#[test]
|
|
|
|
fn triangle_d3d11_args() {
|
|
|
|
let mut args = std::env::args();
|
|
|
|
let _ = args.next();
|
|
|
|
let _ = args.next();
|
|
|
|
let filter = args.next();
|
|
|
|
let image = args
|
|
|
|
.next()
|
|
|
|
.and_then(|f| Image::load(f, UVDirection::TopLeft).ok())
|
|
|
|
.or_else(|| Some(Image::load(IMAGE_PATH, UVDirection::TopLeft).unwrap()))
|
|
|
|
.unwrap();
|
|
|
|
|
|
|
|
let sample = hello_triangle::d3d11_hello_triangle::Sample::new(
|
|
|
|
filter.as_deref().unwrap_or(FILTER_PATH),
|
|
|
|
Some(&FilterChainOptionsD3D11 {
|
|
|
|
force_no_mipmaps: false,
|
|
|
|
disable_cache: false,
|
|
|
|
}),
|
|
|
|
// replace below with 'None' for the triangle
|
|
|
|
Some(image),
|
|
|
|
)
|
2023-02-17 09:33:47 +11:00
|
|
|
.unwrap();
|
2023-02-16 16:39:36 +11:00
|
|
|
// let sample = hello_triangle_old::d3d11_hello_triangle::Sample::new(
|
|
|
|
// "../test/slang-shaders/bezel/Mega_Bezel/Presets/MBZ__0__SMOOTH-ADV.slangp",
|
|
|
|
// Some(&FilterChainOptions {
|
|
|
|
// use_deferred_context: true,
|
|
|
|
// })
|
|
|
|
// )
|
|
|
|
// .unwrap();
|
|
|
|
|
|
|
|
// let sample = hello_triangle_old::d3d11_hello_triangle::Sample::new("../test/basic.slangp").unwrap();
|
|
|
|
|
|
|
|
hello_triangle::main(sample).unwrap();
|
|
|
|
}
|
|
|
|
|
|
|
|
#[test]
|
|
|
|
fn triangle_d3d11() {
|
|
|
|
let sample = hello_triangle::d3d11_hello_triangle::Sample::new(
|
|
|
|
FILTER_PATH,
|
|
|
|
Some(&FilterChainOptionsD3D11 {
|
|
|
|
force_no_mipmaps: false,
|
2024-03-08 12:15:16 +11:00
|
|
|
disable_cache: true,
|
2023-02-16 16:39:36 +11:00
|
|
|
}),
|
|
|
|
// replace below with 'None' for the triangle
|
|
|
|
// None,
|
|
|
|
Some(Image::load(IMAGE_PATH, UVDirection::TopLeft).unwrap()),
|
|
|
|
)
|
2023-02-17 09:33:47 +11:00
|
|
|
.unwrap();
|
2023-02-16 16:39:36 +11:00
|
|
|
// let sample = hello_triangle_old::d3d11_hello_triangle::Sample::new(
|
|
|
|
// "../test/slang-shaders/bezel/Mega_Bezel/Presets/MBZ__0__SMOOTH-ADV.slangp",
|
|
|
|
// Some(&FilterChainOptions {
|
|
|
|
// use_deferred_context: true,
|
|
|
|
// })
|
|
|
|
// )
|
|
|
|
// .unwrap();
|
|
|
|
|
|
|
|
// let sample = hello_triangle_old::d3d11_hello_triangle::Sample::new("../test/basic.slangp").unwrap();
|
|
|
|
|
|
|
|
hello_triangle::main(sample).unwrap();
|
2023-02-17 09:33:47 +11:00
|
|
|
}
|