2022-11-19 17:55:49 +11:00
|
|
|
#![feature(strict_provenance)]
|
|
|
|
|
2022-11-12 13:52:22 +11:00
|
|
|
mod hello_triangle;
|
2022-11-14 17:49:51 +11:00
|
|
|
mod filter_pass;
|
|
|
|
mod util;
|
|
|
|
mod framebuffer;
|
2022-11-20 10:48:54 +11:00
|
|
|
mod binding;
|
2022-11-20 14:09:01 +11:00
|
|
|
mod filter_chain;
|
2022-11-12 13:52:22 +11:00
|
|
|
|
2022-11-09 17:11:25 +11:00
|
|
|
use std::collections::HashMap;
|
|
|
|
use std::error::Error;
|
2022-11-14 16:14:05 +11:00
|
|
|
use std::iter::Filter;
|
2022-11-20 14:03:58 +11:00
|
|
|
use std::ops::Deref;
|
2022-11-09 17:11:25 +11:00
|
|
|
use std::path::Path;
|
2022-11-14 16:14:05 +11:00
|
|
|
use gl::types::{GLenum, GLint, GLsizei, GLsizeiptr, GLuint};
|
|
|
|
use glfw::Key::P;
|
2022-11-09 17:11:25 +11:00
|
|
|
use rustc_hash::FxHashMap;
|
2022-11-12 17:23:49 +11:00
|
|
|
use spirv_cross::spirv::Decoration;
|
2022-11-14 17:49:51 +11:00
|
|
|
use filter_pass::FilterPass;
|
|
|
|
use framebuffer::Framebuffer;
|
2022-11-09 17:51:10 +11:00
|
|
|
|
2022-11-14 17:49:51 +11:00
|
|
|
use librashader::{FilterMode, ShaderFormat, ShaderSource, WrapMode};
|
2022-11-17 16:08:11 +11:00
|
|
|
use librashader::image::Image;
|
2022-11-14 16:14:05 +11:00
|
|
|
use librashader_presets::{ShaderPassConfig, ShaderPreset};
|
2022-11-12 17:23:49 +11:00
|
|
|
use librashader_reflect::back::{CompileShader, ShaderCompilerOutput};
|
|
|
|
use librashader_reflect::back::cross::{GlslangGlslContext, GlVersion};
|
2022-11-11 17:44:41 +11:00
|
|
|
use librashader_reflect::back::targets::{FromCompilation, GLSL};
|
2022-11-09 17:11:25 +11:00
|
|
|
use librashader_reflect::front::shaderc::GlslangCompilation;
|
2022-11-11 17:44:41 +11:00
|
|
|
use librashader_reflect::reflect::cross::CrossReflect;
|
2022-11-12 17:23:49 +11:00
|
|
|
use librashader_reflect::reflect::{ReflectSemantics, ReflectShader, ShaderReflection, UniformSemantic};
|
2022-11-20 10:48:54 +11:00
|
|
|
use librashader_reflect::reflect::semantics::{MemberOffset, SemanticMap, TextureSemantics, UniformMeta, VariableMeta, VariableSemantics};
|
2022-11-09 17:51:10 +11:00
|
|
|
use librashader_reflect::reflect::{TextureSemanticMap, VariableSemanticMap};
|
2022-11-20 10:48:54 +11:00
|
|
|
use binding::{UniformLocation, VariableLocation};
|
|
|
|
use util::{GlImage, RingBuffer, Size, Texture, Viewport};
|
|
|
|
use crate::binding::UniformBinding;
|
2022-11-09 17:11:25 +11:00
|
|
|
|
2022-11-14 16:14:05 +11:00
|
|
|
|
2022-11-09 17:11:25 +11:00
|
|
|
#[cfg(test)]
|
|
|
|
mod tests {
|
2022-11-20 14:09:01 +11:00
|
|
|
use crate::filter_chain::FilterChain;
|
2022-11-09 17:11:25 +11:00
|
|
|
use super::*;
|
|
|
|
|
2022-11-12 13:52:22 +11:00
|
|
|
#[test]
|
|
|
|
fn triangle() {
|
|
|
|
let (glfw, window, events, shader, vao) = hello_triangle::setup();
|
2022-11-19 17:55:49 +11:00
|
|
|
let mut filter = FilterChain::load("../test/basic.slangp").unwrap();
|
|
|
|
|
|
|
|
|
2022-11-17 17:21:29 +11:00
|
|
|
// FilterChain::load("../test/slang-shaders/crt/crt-royale.slangp").unwrap();
|
2022-11-14 16:14:05 +11:00
|
|
|
|
2022-11-19 17:55:49 +11:00
|
|
|
hello_triangle::do_loop(glfw, window, events, shader, vao, &mut filter );
|
2022-11-12 13:52:22 +11:00
|
|
|
}
|
|
|
|
|
2022-11-12 17:23:49 +11:00
|
|
|
// #[test]
|
|
|
|
// fn load_preset() {
|
|
|
|
//
|
|
|
|
// load("../test/basic.slangp")
|
|
|
|
// .unwrap();
|
|
|
|
// }
|
2022-11-09 17:11:25 +11:00
|
|
|
}
|