2022-11-22 17:56:39 +11:00
|
|
|
#![feature(type_alias_impl_trait)]
|
2022-11-26 18:38:15 +11:00
|
|
|
#![feature(let_chains)]
|
2022-11-22 17:56:39 +11:00
|
|
|
|
|
|
|
mod filter_chain;
|
|
|
|
|
2022-11-22 08:13:37 +11:00
|
|
|
use librashader_preprocess::ShaderSource;
|
2022-11-07 16:25:11 +11:00
|
|
|
use librashader_presets::ShaderPassConfig;
|
2022-11-22 08:53:36 +11:00
|
|
|
use librashader_reflect::back::targets::HLSL;
|
|
|
|
use librashader_reflect::back::{CompileShader, FromCompilation};
|
2022-11-26 18:38:15 +11:00
|
|
|
use librashader_reflect::front::shaderc::GlslangCompilation;
|
2022-11-22 08:21:50 +11:00
|
|
|
use rustc_hash::FxHashMap;
|
|
|
|
use std::error::Error;
|
|
|
|
use std::path::Path;
|
2022-11-07 16:25:11 +11:00
|
|
|
|
2022-11-26 18:38:15 +11:00
|
|
|
use librashader_reflect::reflect::semantics::{
|
|
|
|
ReflectSemantics, SemanticMap, TextureSemantics, UniformSemantic, VariableSemantics,
|
|
|
|
};
|
2022-11-22 08:53:36 +11:00
|
|
|
use librashader_reflect::reflect::ReflectShader;
|
2022-11-07 16:25:11 +11:00
|
|
|
|
2022-11-26 18:38:15 +11:00
|
|
|
mod filter_pass;
|
2022-11-22 17:56:39 +11:00
|
|
|
#[cfg(test)]
|
|
|
|
mod hello_triangle;
|
2022-11-26 18:38:15 +11:00
|
|
|
mod texture;
|
2022-11-24 17:37:16 +11:00
|
|
|
mod util;
|
2022-11-27 07:55:14 +11:00
|
|
|
mod samplers;
|
2022-11-27 18:21:36 +11:00
|
|
|
mod render_target;
|
|
|
|
mod framebuffer;
|
2022-11-07 16:25:11 +11:00
|
|
|
|
|
|
|
#[cfg(test)]
|
|
|
|
mod tests {
|
2022-11-26 18:38:15 +11:00
|
|
|
use crate::hello_triangle::DXSample;
|
2022-11-07 16:25:11 +11:00
|
|
|
use super::*;
|
|
|
|
|
|
|
|
#[test]
|
2022-11-27 07:58:26 +11:00
|
|
|
fn triangle_d3d11() {
|
2022-11-26 18:38:15 +11:00
|
|
|
let sample = hello_triangle::d3d11_hello_triangle::Sample::new().unwrap();
|
|
|
|
let device = sample.device.clone();
|
|
|
|
let chain = filter_chain::FilterChain::load_from_path(&device, "../test/slang-shaders/crt/crt-royale.slangp").unwrap();
|
|
|
|
std::mem::forget(chain);
|
|
|
|
hello_triangle::main(sample).unwrap();
|
|
|
|
|
2022-11-07 16:25:11 +11:00
|
|
|
}
|
|
|
|
}
|