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