shader_to_spirv 0.1.1

Get SPIR-V's output easier than ever!
Documentation
  • Coverage
  • 20.83%
    5 out of 24 items documented0 out of 13 items with examples
  • Size
  • Source code size: 26.79 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 2.56 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 27s Average build duration of successful builds.
  • all releases: 27s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Repository
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • Jerrody

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();