|
1 | 1 | # vulkan-tutorial-C-implementation |
| 2 | +\ |
2 | 3 | A C implementation from [vulkan-tutorial.com](https://vulkan-tutorial.com) |
3 | | - |
| 4 | +\ |
4 | 5 | # Why use C ? |
5 | | - |
| 6 | +\ |
6 | 7 | Because C code has simple logic and it suits newbies who doesn't know C++ hardcore features or STL stuff. |
7 | | - |
8 | | - |
9 | | - |
| 8 | +\ |
| 9 | +\ |
| 10 | +\ |
10 | 11 | # How to build ? |
11 | | - |
| 12 | +\ |
12 | 13 | For Linux users: |
13 | | - |
| 14 | +\ |
14 | 15 | Make sure you have a DESKTOP ENVIRONMENT !!! |
15 | | - |
| 16 | +\ |
| 17 | +\ |
16 | 18 | STEP1: Install Necessary Programs |
17 | | - |
| 19 | +\ |
18 | 20 | if you're using Debian, Fedora or Arch, vulkan is available from your repository. |
19 | 21 | Just type install command in console. |
20 | | - |
21 | | - |
22 | | - |
| 22 | +\ |
| 23 | +\ |
| 24 | +\ |
23 | 25 | For Debian(or Ubuntu, or distros based on debian): |
24 | | - |
| 26 | + |
25 | 27 | sudo apt install libvulkan1 vulkan-mesa-drivers vulkan-utils gcc make glslang |
26 | | - |
| 28 | +\ |
27 | 29 | NVIDIA GPU: |
28 | | - |
| 30 | + |
29 | 31 | sudo add-apt-repository ppa:graphics-drivers/ppa |
30 | 32 | sudo apt upgrade |
31 | 33 | sudo apt install nvidia-graphics-drivers-396 nvidia-settings |
32 | | - |
33 | | - |
34 | | - |
35 | | - |
| 34 | +\ |
| 35 | +\ |
| 36 | +\ |
| 37 | +\ |
36 | 38 | For Feodra: |
37 | | - |
| 39 | + |
38 | 40 | sudo dnf install vulkan vulkan-info vulkan-tools gcc make glslang |
39 | | - |
| 41 | +\ |
40 | 42 | NVIDIA GPU: |
41 | | - |
| 43 | + |
42 | 44 | dnf install https://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm https://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm |
43 | 45 | dnf install xorg-x11-drv-nvidia akmod-nvidia |
44 | | - |
45 | | - |
46 | | - |
47 | | - |
| 46 | +\ |
| 47 | +\ |
| 48 | +\ |
| 49 | +\ |
48 | 50 | For Arch Linux(or Manjaro): |
49 | 51 |
|
50 | 52 | sudo pacman -S base-devel vulkan-devel glslang xorg-drivers --needed |
51 | | - |
| 53 | +\ |
52 | 54 | INTEL GPU: |
53 | 55 |
|
54 | 56 | sudo pacman -S vulkan-intel --needed |
55 | | - |
| 57 | +\ |
56 | 58 | AMD READEON GPU: |
57 | 59 |
|
58 | 60 | sudo pacman -S vulkan-radeon --needed |
59 | 61 |
|
60 | 62 | AMD RX GPU: |
61 | 63 |
|
62 | 64 | sudo pacman -S amdvlk --needed |
63 | | - |
| 65 | +\ |
64 | 66 | NVIDIA GPU: |
65 | 67 |
|
66 | 68 | sudo pacman -S nvidia-utils --needed |
67 | | - |
68 | | - |
| 69 | +\ |
| 70 | +\ |
| 71 | +\ |
69 | 72 | For Raspberry Pi: |
70 | 73 |
|
71 | 74 | Download [Manjaro ARM](https://manjaro.org/download/#raspberry-pi-4-xfce) image and burn it to your SD card, because only Manjaro ARM has built-in support for vulkan. |
72 | 75 |
|
73 | 76 | sudo pacman -S base-devel vulkan-devel glslang xorg-drivers vulkan-broadcom --needed |
74 | | - |
75 | | - |
76 | | - |
77 | | - |
| 77 | +\ |
| 78 | +\ |
| 79 | +\ |
| 80 | +\ |
| 81 | +\ |
78 | 82 | STEP2: Test the installation |
79 | | - |
| 83 | +\ |
80 | 84 | type following commands: |
81 | 85 |
|
82 | 86 | vulkaninfo |
83 | 87 | vkcube |
84 | | - |
| 88 | +\ |
85 | 89 | If no error occurs, vulkan is set correctly. |
86 | | - |
87 | | - |
88 | | - |
| 90 | +\ |
| 91 | +\ |
| 92 | +\ |
| 93 | +\ |
| 94 | +\ |
89 | 95 | STEP3: Download Codes |
90 | | - |
91 | | -Download via ZIP |
92 | | - |
93 | | - |
94 | | - |
95 | | - |
96 | | - |
| 96 | +\ |
| 97 | +Download via ZIP or Release Tarball |
| 98 | +\ |
| 99 | +\ |
| 100 | +\ |
| 101 | +\ |
| 102 | +\ |
97 | 103 | STEP4: use Makefile |
98 | 104 |
|
99 | 105 | make #install |
100 | 106 | ./op #run |
101 | 107 | make cl #remove |
102 | | - |
103 | | - |
104 | | - |
105 | | - |
| 108 | +\ |
| 109 | +\ |
| 110 | +\ |
| 111 | +\ |
| 112 | +\ |
106 | 113 | For Windows users: |
107 | 114 |
|
108 | 115 | I don't use Windows for programming, so follow the guide from [The Original Site](https://vulkan-tutorial.com/Development_environment). |
109 | 116 |
|
110 | 117 | By the way, Makefile is useless on Windows, copy the code in Visual Studio project and build it. |
111 | | - |
112 | | - |
113 | | - |
114 | | - |
| 118 | +\ |
| 119 | +\ |
| 120 | +\ |
| 121 | +\ |
| 122 | +\ |
115 | 123 | For MacOS users: |
116 | | - |
| 124 | +\ |
117 | 125 | [MoltenVK official github page](https://github.com/KhronosGroup/MoltenVK) |
118 | | - |
| 126 | +\ |
119 | 127 | OR: |
120 | 128 |
|
121 | 129 | brew install vulkan-headers molten-vk gcc make glslang |
122 | | - |
123 | | - |
124 | | - |
125 | | - |
126 | | - |
| 130 | +\ |
| 131 | +\ |
| 132 | +\ |
| 133 | +\ |
0 commit comments