Crates.io | proc-spirv |
lib.rs | proc-spirv |
version | 0.0.1 |
source | src |
created_at | 2019-02-22 03:29:44.051639 |
updated_at | 2019-02-22 03:29:44.051639 |
description | procedural macro your SPIR-V creation. |
homepage | |
repository | https://github.com/Lokathor/proc-spirv |
max_upload_size | |
id | 116407 |
size | 10,572 |
A proc-macro crate to get your shaders compiled into SPIR-V at compile time.
Currently, we use the shaderc crate, but that's not considered a "stable" part of the API. Anything that turns GLSL into SPIR-V would work in the long term. If someone comes up with a solid pure-rust GLSL to SPIR-V compiler, we could easily switch to that.
Probably no one will do that because people are lazy.
If you want to have some SPIR-V shader code in your program but you do not need to have your program be compiling new shaders at runtime, you can use this crate's proc-macro instead to do all the processing at compile time only. This makes your final binary smaller, because it's not carrying around a SPIR-V compiler. It also makes your graphics stuff startup faster, because all the shaders don't need to be compiled at runtime.