spirv_cross

Bindings to Khronos' SPIRV-Cross


Keywords
library, graphics
License
MIT
Install
dub fetch spirv_cross --version 0.4.0

Documentation

spirv_cross-d

D bindings to Khronos' SPIRV-Cross

Automatically builds and statically links to the C++ library through a provided C wrapper.

On Windows X86 DMD, only mscoff libs are supported. (Dub flag --arch=x86_mscoff)

Example:

import std.stdio;
import spirv_cross;

void main()
{
    auto spirv = cast(immutable(uint)[])import("shader.vert.spv");

    auto cl = new ScCompilerGlsl(spirv);
    scope(exit) cl.dispose();

    auto opts = cl.options;
    opts.ver = 130;
    cl.options = opts;

    writeln(cl.compile());
}