Chapter 2. Your First Vulkan Pseudo Program

In the last chapter, we provided a very basic introduction to visualize the new Vulkan API. We hovered through the high-level ecosystem design of this API and also understood the internal module's functionality to learn its execution model.

In this chapter, we will learn about the installation process to get ready to work with Vulkan pseudocode programming. The explicit nature of Vulkan makes the programming verbose. In Vulkan, a simple Hello World!!! program may end up with around 1,500 lines of code. This means trying even a simple example will be a challenge for beginners. But let's not hit the panic button; we will go through the entire Hello World!!! program with a simple pseudocode programming model.

Beginners will also learn about a step-by-step approach to building their first Vulkan application in a user-friendly way. In the following chapters of this book, we will delve into the real coding process and get our hands dirty with Vulkan programming. So the learning process is divided into several modules and split across multiple chapters.

This chapter lays the foundation for the remaining chapters. Here, we will build a very simple Hello World!!! pseudocode program, where we will understand the process of building a simple tricolored triangle using Vulkan. We will cover the following topics:

  • Installing Vulkan
  • The Hello World!!! pseudocode program
  • Fitting it all together

Installing Vulkan

Enough discussing about Vulkan. Now we will delve into the installation process and learn all we need to make Vulkan work.

Tip

Before you go ahead with the installation, please go through the software-hardware requirements, which you will find in the code files provided with this book. If your system complies with the requirements mentioned, you are good to go with the installation process.

Please follow these instructions to install Vulkan:

  1. The Vulkan driver: Most vendors now have their Vulkan support included in the normal driver package. First, install the Vulkan driver. You can choose the installation location; otherwise, the default location will do. For instance, if you are installing NVIDIA drivers, the installer first checks the system configuration to scan any compatibility issues with the installing driver. It will upgrade any preinstalled driver on the system.
  2. Install Python: Install Python and make sure you add it to the path. This can be done by simply placing a tick against the Add Python <version> to PATH checkbox.
  3. Install CMake: Next, install CMake. Ensure you select Add CMake to the system PATH for all users. You can use the default location for installation.
  4. Install the SDK: Install the LunarG SDK. The default location should be fine.

Note

The LunarG SDK contains the Vulkan specification, manual, and the necessary libraries that will be helpful in building the project. It also contains demo samples that can be quickly launched to check the status of the installation. If you are able to run the sample executable successfully, it means the Vulkan driver and SDK are installed properly. You can find these samples under <Lunar-G SDK Path>/Bin or <Lunar-G SDK Path>/Bin32 for 32 bits systems.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.14.131.47