Crate vulkanology [] [src]

This crate provides macros for writing simple vulkan compute shader tests using the tomaka/vulkano library.


A core problem of developing shaders is the rather difficult environment in which they are executed. Even simple things can go wrong and cost the developer a lot of time to fix. This crate aims at providing a simple-to-use environment for writing vulkan compute shader tests. It uses the vulkano rust-vulkan bindings end exports macros for a fast implementation of tests. These macros mostly generate vulkano boilerplate instantiation code. The interface to the shader are CPU accessible buffers which you can read and write at will and a function for executing the shader code and waiting for the result.

Import (Usage in integration test modules)

Due to the reexport of utility function from the vulkano crate (which you don't need to access, unless you want to) you need to use the following crates in your test module header:

extern crate vulkano;
extern crate vulkanology;

For basic usage of the library you can refer to the doc-tests and tests/shaders/example.comp. For a working example of a fairly elaborate shader test please refer to: tests/ and tests/shaders/random.comp.

Building GLSL shaders

This utility pack is built around the vulkano library, which also provides vulkano-shaders, a library which compiles GLSL shaders into Rust interface modules. For examples on how to build shaders with vulkano-shaders see and this.

Composite shader tests

vulkanology also provides some build utilities for working with segmented shaders. src/ contains working examples on how to use these utilities in your



This module exports shader building tools which simplify the test shader building process.



Creates a new uninitialized buffer of type $buf_type of length $buf_len.


Creates a Device and a Queue for compute operations.


A simple macro for generating the build code which concatenates the correct test shader segments.


Creates a vulkano. Does not enable any instance extensions.


This macro generates code for loading a PhysicalDevice. It takes the instance variable name and an optional list of features which the device should support. All available features are defined here.


This macro is the core of the shader-testing framework. It generates code for initializing the vulkano environment, it allocates CpuAccessibleBuffers, it compiles the shader, it sets up a ComputePipeline and provides a function for executing the shader.