Crates.io | shader_to_spirv |
lib.rs | shader_to_spirv |
version | 0.1.1 |
source | src |
created_at | 2021-12-03 22:41:02.679296 |
updated_at | 2021-12-03 22:43:15.131183 |
description | Get SPIR-V's output easier than ever! |
homepage | |
repository | https://github.com/Jerrody/shader_to_spirv |
max_upload_size | |
id | 491991 |
size | 19,009 |
shader_to_spirv
usageshader_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.
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();