shader_to_spirv

Crates.ioshader_to_spirv
lib.rsshader_to_spirv
version0.1.1
sourcesrc
created_at2021-12-03 22:41:02.679296
updated_at2021-12-03 22:43:15.131183
descriptionGet SPIR-V's output easier than ever!
homepage
repositoryhttps://github.com/Jerrody/shader_to_spirv
max_upload_size
id491991
size19,009
George (Jerrody)

documentation

README

shader_to_spirv usage

shader_to_spirv crate provides very easy way to create a SPIR-V's output.

But it's still in development could be bugs and some species of issues. If you found one of them, please, report or make PR! Always are welcome.

Supported Shader Languages

  • WGSL
  • GLSL
  • HLSL

Examples

let vs_shader: Vec<u32> = SpirvBuilder::new(
    "../path/to/my_shader.vert",
    ShaderType::Glsl,
    ShaderInfo::new(ShaderStage::Vertex, "main"),
    )
    .unwrap();
let fs_shader: Vec<u32> = SpirvBuilder::new(
    "../path/to/my_shader.wgsl",
    ShaderType::Wgsl,
    ShaderInfo::new(ShaderStage::Fragment, "fs_main"),
    )
    .unwrap();

Also, you can do like this:

let vs_shader: Vec<u32> = SpirvBuilder::new(
    "../path/to/my_shader.frag",
    ShaderType::Glsl,
    ShaderInfo::new(ShaderStage::Vertex, "main"),
    )
    .with_shader_type(ShaderStage::Fragment)
    .unwrap();
Commit count: 0

cargo fmt