Skip to content

Commit

Permalink
update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
esettes authored Dec 8, 2022
1 parent 50fd30f commit 8b95306
Showing 1 changed file with 29 additions and 4 deletions.
33 changes: 29 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,38 @@
## Compute shader with Vulkan
# Compute shader with Vulkan

#### Initialization of a Vulkan program to execute a compute shader.
### Initialization of a Vulkan program to execute a compute shader.

### Contents
## Contents
- [Introduction](#Introduction)
- [Initialization](#Initialization)

<a name='Introduction'></a>

## Introduction

Something that Vulkan have different than another graphic API it's that it add one more step in the process to start to work with GPU. It works with an instance.
Compute shaders are a special type of shader that doesn’t use the fixed graphics pipeline, and just allows to run arbitrary computations on the GPU.

Generation of an image(1000x1000) of a simple fractal and compare the processing time(miliseconds) needed by the CPU and the GPU:


#### &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; CPU time: 285 ms. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; GPU time: 4 ms.
<p align="left">
<img height="230px" src="https://github.com/esettes/compute_shader_vulkan/blob/main/img/fractal_cpu.png" />
<img height="230px" src="https://github.com/esettes/compute_shader_vulkan/blob/main/img/fractal_gpu.png" />
</p>
<a name='Initialization'></a>

## Initialization

### 1. Create an instance

Something that Vulkan have different than another graphics API it's that it add one more step in the process to start to work with GPU. It works with an instance.

Validator layers are included here --

### 2. Obtain physical device

Enumerate all physical devices from the instance. `vkGetPhysicalDeviceProperties` allows to see significant information about each device.

3.

0 comments on commit 8b95306

Please sign in to comment.