diff --git a/.idea/src.iml b/.idea/src.iml
index 1f841a2..c85c8a8 100644
--- a/.idea/src.iml
+++ b/.idea/src.iml
@@ -11,6 +11,7 @@
+
diff --git a/Cargo.lock b/Cargo.lock
index 51f00ee..737c951 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -429,7 +429,6 @@ version = "0.1.0"
dependencies = [
"bitflags",
"librashader",
- "librashader-preprocess",
"naga",
"rspirv",
"rspirv-reflect",
diff --git a/librashader-reflect/Cargo.toml b/librashader-reflect/Cargo.toml
index 6a89941..48593ea 100644
--- a/librashader-reflect/Cargo.toml
+++ b/librashader-reflect/Cargo.toml
@@ -16,5 +16,5 @@ rustc-hash = "1.1.0"
rspirv = "0.11.0+1.5.4"
rspirv-reflect = { git = "https://github.com/Traverse-Research/rspirv-reflect" }
+
[dev-dependencies]
-librashader-preprocess = { path = "../librashader-preprocess", default-features = false }
diff --git a/librashader-reflect/src/back/cross.rs b/librashader-reflect/src/back/cross.rs
index cd0932c..28c7eac 100644
--- a/librashader-reflect/src/back/cross.rs
+++ b/librashader-reflect/src/back/cross.rs
@@ -1,4 +1,39 @@
-use crate::back::ShaderCompiler;
-use crate::back::targets::GLSL;
-use crate::error::ShaderCompileError;
-use crate::reflect::ShaderReflection;
+use crate::back::targets::{CompilerBackend, FromCompilation, GLSL, HLSL};
+use crate::back::CompileShader;
+use crate::error::{ShaderCompileError, ShaderReflectError};
+use crate::front::shaderc::GlslangCompilation;
+use crate::reflect::cross::{GlslReflect, HlslReflect};
+use crate::reflect::{ReflectShader, ShaderReflection};
+
+pub type GlVersion = spirv_cross::glsl::Version;
+impl FromCompilation for GLSL {
+ type Target = GLSL;
+ type Options = GlVersion;
+
+ fn from_compilation(
+ compile: GlslangCompilation,
+ ) -> Result<
+ CompilerBackend + ReflectShader>,
+ ShaderReflectError,
+ > {
+ Ok(CompilerBackend {
+ backend: GlslReflect::try_from(compile)?,
+ })
+ }
+}
+
+impl FromCompilation for HLSL {
+ type Target = HLSL;
+ type Options = Option<()>;
+
+ fn from_compilation(
+ compile: GlslangCompilation,
+ ) -> Result<
+ CompilerBackend + ReflectShader>,
+ ShaderReflectError,
+ > {
+ Ok(CompilerBackend {
+ backend: HlslReflect::try_from(compile)?,
+ })
+ }
+}
diff --git a/librashader-reflect/src/back/mod.rs b/librashader-reflect/src/back/mod.rs
index c1e3190..ca0c953 100644
--- a/librashader-reflect/src/back/mod.rs
+++ b/librashader-reflect/src/back/mod.rs
@@ -1,8 +1,11 @@
+pub mod cross;
pub mod targets;
-mod cross;
use std::fmt::Debug;
-pub use targets::ShaderCompiler;
+use rustc_hash::FxHashMap;
+pub use targets::CompileShader;
+use crate::reflect::semantics::{SemanticMap, TextureSemantics};
+use crate::reflect::UniformSemantic;
#[derive(Debug)]
pub struct CompiledShader