Skip to content

necrashter/minimal-vulkan-compute-shader

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

A minimal application with Vulkan compute shaders

In this repository you will find a minimal Vulkan application that uses compute shaders. You can use this as a starting point for your project.

I created a video explaining Vulkan compute shaders and this code, alongside the corresponding blog post which contains more information about the references. You can also access the slides from there.

The Vulkan code is based on this tutorial. However, unlike the tutorial, the shader in this repository is written in GLSL instead of HLSL. I also created a build system with CMake.

Building

CMake is used for building the application. Vulkan SDK needs to be installed. GLSL compiler glslc must be installed and in your PATH.

Create build folder:

$ mkdir bin
$ cd bin

Configure:

$ cmake ..

Compile & run:

$ make
$ ./main

I compiled and tested this program only on Linux.

Contributions are welcome.

Expected Output

The program just squares the numbers 0 to 9 in a compute shader.

Device Name    : Intel(R) HD Graphics 630 (KBL GT2)
Vulkan Version : 1.2.182
Compute Queue Family Index: 0
Memory Type Index: 0
Memory Heap Size : 11 GB

INPUT:  0 1 2 3 4 5 6 7 8 9 
OUTPUT: 0 1 4 9 16 25 36 49 64 81

About

A minimal application with Vulkan Compute Shaders

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published