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

61 lines
1.9 KiB
Rust
Raw Normal View History

2022-11-19 17:55:49 +11:00
#![feature(strict_provenance)]
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;
mod filter_chain;
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-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};
use librashader_reflect::back::targets::{FromCompilation, GLSL};
2022-11-09 17:11:25 +11:00
use librashader_reflect::front::shaderc::GlslangCompilation;
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};
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 {
use crate::filter_chain::FilterChain;
2022-11-09 17:11:25 +11:00
use super::*;
#[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 17:23:49 +11:00
// #[test]
// fn load_preset() {
//
// load("../test/basic.slangp")
// .unwrap();
// }
2022-11-09 17:11:25 +11:00
}