vulkano/vulkano-shader-derive
2017-02-02 21:11:47 +01:00
..
src Add a small crate to allow inlining shader source codes 2017-01-21 16:17:06 +01:00
Cargo.toml Publish 0.3.2 2017-02-02 21:11:47 +01:00
README.md Add small README for the new crate 2017-01-21 16:32:53 +01:00

Usage

This replaces vulkano-shaders.

#[macro_use]
extern crate vulkano_shader_derive;

mod fs {
    #[derive(VulkanoShader)]
    #[ty = "fragment"]
    #[src = "
#version 450

#extension GL_ARB_separate_shader_objects : enable
#extension GL_ARB_shading_language_450pack : enable

layout(location = 0) out vec4 f_color;

void main() {
    f_color = vec4(1.0, 0.0, 0.0, 1.0);
}"]
    struct Dummy;
}

let fs = fs::Shader::load(&device).expect("failed to create shader module");