[][src]Crate geyser

This crate aims to make the use of vulkano quicker and easier when working on small project. The main things you should look at are:

Example

use geyser::instance::Instance;
 
// Instantiate vulkano
let inst = Instance::new();
 
// Create compute pipeline
let pipeline = create_compute_pipeline!(
    inst, "
#version 450
 
layout(set = 0, binding = 0) buffer Data {
    uint data[];
} buf;
 
void main() {
    uint idx = gl_GlobalInvocationID.x;
 
    buf.data[idx] = idx * 12;
}
");
 
// Create buffer
let buf = inst.create_buffer_from_data(vec![0; 69]);
 
// Create descriptor set
let set = create_descriptor_set!([buf], pipeline);
 
//Run the calculations on the GPU
inst.dispatch([69, 1, 1], pipeline.clone(), set.clone());
 
//Display the results
buf.read().expect("Failed to read from buffer")
    .iter().enumerate().for_each(|(i, x)| println!("Index: {} equals: {}", i, *x));

Re-exports

pub extern crate vulkano;
pub extern crate vulkano_shaders;

Modules

compute

This module contains macros and structs for GPGPU

instance

This module contains a struct for instancing vulkano and provides methods for easily creating buffers ect.

Macros

create_compute_pipeline

Creates a Arc<ComputePipeline>. It takes the code for the shader as literate sting and an Instance.

create_descriptor_set

Creates an Arc<PersistantDescriptorSet> from list of buffer and a pipeline