vk-shader-macros 0.1.0

Procedural macros for working with Vulkan shaders
Documentation

vk-shader-macros

Crates.io License: MIT License: Apache 2.0

A procedural macro for compiling GLSL into SPIR-V constants.

Unlike the standard include_bytes macro, paths are currently resolved relative to crate root. This is due to a temporary limitation in the procedural macro API.

Examples

const VERT: &[u32] = include_glsl!("shaders/example.vert");
const FRAG: &[u32] = include_glsl!("shaders/example.glsl", kind: frag, debug);

Dependencies

This crate currently depends on the foreign shaderc library. By default, it will be compiled automatically, requiring git, cmake, python 3, and a supported C++ compiler to be available in the build environment. A pre-compiled shaderc can be used by disabling the crate's default features, but care must be taken to use a version that is binary-compatible with the one checked out by the shaderc crate.