-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
29 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: | ||
|
||
|
||
#### CPU time: 285 ms. 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. | ||
|