Vulkan Tutorial 01 Development environment built Windows

Source: Internet
Author: User

Operating system: Windows8.1

Graphics: Nivida gtx965m

Development tools: Visual Studio 2017

I believe many people begin to learn Vulkan development in the beginning of the development environment will be in the configuration of some effort, then this question will guide you to quickly complete the Vulkan under Windows Development environment, and use a few common development tools library.

Vulkan SDK

The most important component needed to develop an Vulkan application is the SDK. It includes the core header files, the standard validation layers and debug toolset, and the driver loader, if these keywords are not very clear now, it does not matter, I will be in the follow-up tutorial to explain to you.

First download the SDK, log on to the LUNARG website The Lunarg website, choose the latest SDK download installation under the Windows platform, especially note that this SDK includes a lot of content, such as samples, documents, these materials are very helpful to learn.

Continue to install and note the location of the SDK installation, after the installation is complete we first verify that your PC graphics driver supports Vulkan, go to the directory where the SDK is installed, open the Bin32 directory to run the Cube.exe demo program, you will see the following content.

If you receive an exception, make sure that your graphics card driver is up-to-date, and that the hardware driver supports Vulkan runtime, specific details can be confirmed on the website of each card manufacturer.

There are two other programs in this directory that are valuable for development, and the Vkjson_info.exe program generates a JSON file and uses Vulkan to selectively open features based on specific hardware parameters.

Of course there is also an address where you can see different support for the VULKANSDK API version of the video card. http://vulkan.gpuinfo.org/

The GlslangValidator.exe program will be used to compile the shader from a readable GLSL to a byte code. We'll cover this in depth in the Shader module chapter. The Bin32 directory also contains binaries for the Vulkan loader and the validation layer, and the LIB32 directory contains libraries. The doc directory contains useful information about the Vulkan SDK and an offline version of the entire Vulkan specification. Finally, the Include directory containing the Vulkan header file.

Glfw

Vulkan does not contain tools for creating Windows to render content, and for cross-platform considerations, SDL is used as a window system implementation in sample, and this tutorial uses the GLFW library to create a Windows-enabled window. His advantage lies in abstracting the content of other platforms in Vulkan.

The latest version can be downloaded at GLFW, and in this tutorial we will use the 32-bit library

After downloading the header file directory GLFW, Static library glfw3.lib, Glfw3dll.lib, dynamic library Glfw3.dll respectively into the VULKANSDK installation directory in the corresponding directory of Third-party.

GLM

Vulkan does not include a utility library for mathematical calculations, so we introduced the GLM library, which is designed for the graphics API and is heavily used with OpenGL programs.

Note that VULKANSDK currently contains GLM in Third-part | The Include directory.

GLM contains only one header file, so you only need to download the latest version and place it in the VULKANSDK as above GLFW | Third-part | The Include directory.

Setting up Visual Studio

To create a new test program from the Vulkan template, note that after the new project is created, Vulkan vs template automatically creates a program based on the SDL window, where you can remove or replace the test code below.

Create a new test C + + file and add the following test code.

#defineGlfw_include_vulkan#include<GLFW/glfw3.h>#defineGlm_force_radians#defineGlm_force_depth_zero_to_one#include<glm/vec4.hpp>#include<glm/mat4x4.hpp>#include<iostream>intMain () {glfwinit ();    Glfwwindowhint (Glfw_client_api, GLFW_NO_API); Glfwwindow* Window = Glfwcreatewindow ( -, -,"Vulkan window", nullptr, nullptr); uint32_t Extensioncount=0; Vkenumerateinstanceextensionproperties (nullptr,&Extensioncount, nullptr); Std::cout<< Extensioncount <<"Extensions supported"<<Std::endl;    GLM::MAT4 Matrix;    GLM::VEC4 VEC; Auto Test= Matrix *VEC;  while(!glfwwindowshouldclose (window))    {glfwpollevents ();    } glfwdestroywindow (window);    Glfwterminate (); return 0;}

You will encounter compilation error GLFW, and now add a specific library reference.

Run the program again, congratulations you can see the first Vulkan program running up.

Vulkan Tutorial 01 Development environment built Windows

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.