transhader 0.1.1

Transpile shaders on the fly using procedural macros.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use naga::back::hlsl::{Options, Writer};
use naga::Module;

use crate::util::validate;

pub(crate) fn to_hlsl(module: Module) -> String {
    let mut out = String::new();

    Writer::new(
        &mut out,
        &Options::default(), // TODO: custom options
    )
    .write(&module, &validate(&module))
    .expect("Failed to write HLSL Module");

    out
}