Vulkan lunarg com sdk home windows

The Vulkan SDK includes the Khronos‐branded Vulkan loader binary for Linux and macOS. On Windows, the Vulkan Loader is delivered with the hardware vendor driver update packages. The loader discovers and manages the Vulkan devices and layers available to the application.

The Vulkan SDK Includes:

Vulkan Loader

The Vulkan SDK includes the Khronos‐branded Vulkan loader binary for Linux and macOS. On Windows, the Vulkan Loader is delivered with the hardware vendor driver update packages. The loader discovers and manages the Vulkan devices and layers available to the application.

Vulkan Application Developer Tools

The SDK provides you with tools to assist the developer during application development. Common tools are the Validation Layers, apidump, vulkaninfo, and capture/replay tools.

Vulkan Capture Tools

The capture and replay tools allow you to capture API calls in binary format and play them back. This is useful for sharing traces when debugging your applications with third parties (such as IHVs) without having to share the application. For application developers it can be useful to validate that the application is executing Vulkan API usage as expected.

SPIR‐V™ Tools

SPIR‐V is a new binary intermediate representation (IR) for graphical shaders and compute kernels. The Vulkan graphics API requires the SPIR‐V format for all shaders. To help you meet this requirement, the SDK includes tools for proper shader generation, GLSL and HLSL conversion, inspection, and compression improvement.

SDK Documentation

Each SDK is for a Vulkan header version. Online documentation for all the tools in the SDK is included as well as builds of the Vulkan specification for the header version.

Vulkan Samples and Tutorial

An online Vulkan tutorial is provided that will take the user through the steps to render a basic object on the screen. In addition, there are simple Vulkan samples that demonstrate the use of some of the Vulkan API calls.

Benefits of Using the SDK

  • Provides your developers with the essential tools needed for developing Vulkan applications
  • Streamlines the process of developing applications in Vulkan by delivering pre-built versions of key developer’s tools relative to the Vulkan header version

Our Work with the Khronos Group

LunarG has a long-standing partnership with the Khronos Group, a technology consortium that works to develop advanced, royalty-free, acceleration standards for 3D graphics. LunarG is also actively involved in influencing the Vulkan specification process, and in representing its clients’ needs at Vulkan Working Group meetings.

Find answers to your most pressing questions about the Vulkan SDK.

Read FAQ

White Paper

Vulkan SDK Version Compatibility

Need Help with
3D Graphics Software?

Interested in LunarG software services or have a unique need that you don’t see represented here? Let’s talk about your project…

Как скачать оригинальный vulkan-1.dllПри запуске некоторых игр пользователи могут столкнуться с ошибкой «Не удается продолжить выполнение кода, поскольку система не обнаружила vulkan-1.dll» или «Запуск программы невозможен, так как на компьютере отсутствует vulkan-1.dll».

В этой пошаговой инструкции подробно о том, как скачать vulkan-1.dll с официального сайта или в комплекте драйверов для Windows 11, Windows 10 и 7, чтобы исправить ошибку при запуске игр и программ.

Vulkan-1.dll в составе Vulkan Runtime Libraries в комплекте драйверов видеокарты

Ошибка система не обнаружила vulkan-1.dll

Vulkan-1.dll представляет собой один из файлов, входящих в комплект Vulkan Runtime Libraries — библиотек, которые могут использоваться в различных играх для Windows 11, 10 или Windows 7 (а также других платформ) с игровыми движки от Valve и не только.

Свойства оригинального файла vulkan-1.dll

Не следует вручную скачивать отдельный файл vulkan-1.dll, копировать его в папку System32 или SysWOW64 и пробовать зарегистрировать в системе: с большой вероятностью, это не решит проблему и, кроме этого, не вполне безопасно.

Пакет библиотек Vulkan Runtime Libraries по умолчанию поставляется и устанавливается вместе с драйверами видеокарты. Если драйверы видеокарты были установлены системой автоматически, рекомендую вручную скачать последнюю версию драйверов с официального сайта NVIDIA GeForce, AMD Radeon и Intel и установить их. После установки и перезагрузки компьютера, проблема должна быть решена — файлы vulkan-1.dll как x64 так и 32-бит будут установлены в необходимые расположения на вашем компьютере или ноутбуке.

Ранее (в старых версиях драйверов) после установки в списке установленных программ Windows появлялся пункт Vulkan Run Time Libraries, в новых версиях драйверов не появляется. Однако, вы можете легко проверить наличие библиотек Vulkan: нажмите клавиши Win+R, введите vulkaninfo и нажмите Enter. Если откроется окно со служебной информацией о версиях и поддерживаемых функциях Vulkan, значит необходимые DLL в наличии.

Выполнение vulkaninfo в Windows

Следует учитывать следующий момент: если у вас очень старая видеокарта и для неё доступны лишь старые версии драйверов, Vulkan может отсутствовать в комплекте. Вы можете ознакомиться со списком видеокарт и версий драйверов, где vulkan-1.dll и остальные компоненты присутствуют на сайтах:

  • Для NVIDIA GeForce — https://developer.nvidia.com/vulkan-driver
  • Для AMD Radeon — https://gpuopen.com/version-table/

Как скачать установщик Vulkan Runtime Libraries (VulkanRT) отдельно с официального сайта

Если предыдущий метод по какой-то причине вам не подходит, вы можете скачать vulkan-1.dll в составе Vulkan Runtime Libraries с официального сайта разработчика:

  1. Зайдите на официальный сайт загрузки Vulkan — https://vulkan.lunarg.com/sdk/home
  2. В разделе «Windows» нажмите «Latest Runtime/ZIP» или по файлу установщика в пункте Runtime.
  3. Скачайте файл установщика (Runtime Installer) и запустите установку. Скачать Vulkan Runtime Libraries

После установки Vulkan Runtime Libraries (может потребоваться перезагрузка компьютера), файл vulkan-1.dll будет располагаться в папках C:WindowsSystem32 и C:WindowsSysWOW64 и нужным образом зарегистрирован в Windows. Следует учитывать, что Vulkan может не поддерживаться или иметь ограниченную поддержку на очень старых видеокартах.

Drivers, SDKs and More

Vulkan GPU Resources

Behind every great API is the supporting software that bring it life on your GPU. Check out the available resources by company below.

SDK

Download these essential development tools

Essentials tools, documentation and libraries for every Vulkan developer

Download these essential development tools


Detroit Become Human — Quantic Dream

SDK

Download these essential development tools

Essentials tools, documentation and libraries for every Vulkan developer

  • LunarG has developed the quintessential developer SDK including build tools, documentation, libraries and more.

    Find Out More

  • Google gives you everything you need to incorporate Vulkan into your Android games and other apps where graphics performance is key.

    Visit the Android developer website to download the API, samples, and documentation: resources to help you hit the ground running.

    Find Out More

  • ARM’s Vulkan Software Development Kit is a collection of resources to help you build Vulkan applications for a platform with a Mali GPU and an ARM processor. You can use it for creating new applications, training, and exploration of implementation possibilities

    Find Out More

  • The PowerVR SDK is an open source codebase to help with the development of graphics applications for PowerVR and other platforms. It consists of two main parts: the Framework and a set of examples.

    Find Out More

Deep Dive

Profilers and debuggers

Tools to take a low level look at your application, debug and achieve the absolute best performance

Profilers and debuggers


Hitman 3 — IO Interactive

Deep Dive

Profilers and debuggers

Tools to take a low level look at your application, debug and achieve the absolute best performance

  • The AMD Radeon™ GPU Profiler is a ground-breaking low-level optimization tool that provides detailed information on Radeon™ GPUs.

    Find Out More

  • AGI is a cross-vendor open source tool with system and frame profiling support for Vulkan applications on the Android platform.

    Find Out More

  • Arm Mobile Studio offers free mobile app development tools for manual analysis of app performance across mobile devices and a Professional Edition for importing that data directly into a continuous integration workflow.

    Find Out More

  • A cross-platform Vulkan layer which checks Vulkan applications for recommended API usage on Arm Mali devices

    Find Out More

  • NVIDIA Nsight™ allows you to build and debug integrated GPU kernels and native CPU code as well as inspect the state of the GPU and memory

    Find Out More

  • The Snapdragon Profiler provides Vulkan developers with low level counters and metrics that help them get accurate timing and insight on what happens on the Adreno GPU.

    Find Out More

  • RenderDoc is a frame-capture based graphics debugger, currently available for Vulkan, D3D11, D3D12, OpenGL, and OpenGL ES development on Windows 7 — 10, Linux, Android, Stadia, and Nintendo Switch™. It is completely open-source under the MIT license

    Find Out More

  • Tracy is a real time, nanosecond resolution, remote telemetry, hybrid frame and sampling profiler. Tracy supports profiling CPU , GPU (including Khronos APIs: Vulkan, OpenGL, OpenCL), memory allocations, locks, context switches and more.

    Find Out More

GPU PROGRAMMING

Shader Tools

Here you’ll find info (spec, documentation) and development tools for developing shaders for Vulkan. Vulkan has support for shaders written in HLSL and GLSL — and if you want to go deeper, SPIRV intermediate representation is is the target IR for all Vulkan shaders.

Shader Tools


Hitman 3 — IO Interactive

GPU PROGRAMMING

Shader Tools

Here you’ll find info (spec, documentation) and development tools for developing shaders for Vulkan. Vulkan has support for shaders written in HLSL and GLSL — and if you want to go deeper, SPIRV intermediate representation is is the target IR for all Vulkan shaders.

    • HLSL Documentation

      HLSL is the C-like high-level shader language that you use with programmable shaders in DirectX.

    • DXC Github Repository

      The DirectX Shader Compiler project includes a compiler and related tools used to compile High-Level Shader Language (HLSL) programs into Intermediate Language (DXIL, SPIRV) representation.

    • HLSL to SPIR-V mapping

      This document describes the mappings from HLSL features to SPIR-V for Vulkan adopted by the SPIR-V codegen.

    • GLSL wiki

      The OpenGL Shading Language is a C-style language and covers most of the features you would expect with such a language.

    • GLSL Spec (PDF)

      This document specifies version 4.60 of the OpenGL Shading Language (GLSL)

    • GLSL Github Repository

      GLSL and ESSL are Khronos high-level shading languages. Vulkan makes use of GLSL and ESSL, via SPIR-V.

    • glslang reference compiler front end

      glslang is the official reference compiler front end for the OpenGL and OpenGL ES shading languages. If you wish to assure that SPIR-V generated from HLSL is legal for Vulkan, also install spirv-tools.

    • SPIR-V Overview

      SPIR-V is catalyzing a revolution in the ecosystem for shader and kernel language compilers used for expressing parallel computation and GPU-based graphics.

    • SPIR-V Spec Registry

      SPIR-V is a binary intermediate language for representing graphical-shader stages and compute kernels for multiple Khronos APIs, including OpenCL, OpenGL, and Vulkan.

    • SPIR-V Guide

      The SPIR-V Guide is designed to help developers get up and going with the world of SPIR-V. This guide is targeted at developers needing to use compilers SPIR-V in their tool chains and for developers wishing to develop custom tooling or compilers that outputs SPIR-V.

    • SPIR-V Tools

      The SPIR-V Tools project provides an API and commands for processing SPIR-V modules. The project includes an assembler, binary module parser, disassembler, validator, and optimizer for SPIR-V.

Engines

Looking to take your project to the next level? Look no further: Here are several engines that currently support Vulkan.

Acid Logo

Acid is an open-source, cross-platform game engine written in modern C++17 with a focus on modularity and simplicity

Find out more

CryEngine Logo

CRYENGINE, Crytek’s proprietary game engine is available for creators all across the globe to harness the power behind IPs like Crysis, Ryse: Son of Rome, The Climb and Hunt: Showdown. Start achieving; dare to create world-class gaming experiences, no matter the budget or team size.

Find out more

Flax Logo

Flax is a fully-featured multi-platform 3D game engine. It brings awesome experience to the game development that scales from small to large teams.

Flax Engine

GoDot Logo

Godot is completely free and open-source under the very permissive MIT license.

Find out more

NAP Framework Logo

NAP framework is an open source, data-driven platform that merges game technology with the flexibility of a creative coding environment. NAP allows you to create fast, modular, stable applications.

Find out more

O3DE Logo

Open 3D Engine (O3DE) is an Apache 2.0-licensed multi-platform 3D engine that enables developers and content creators to build AAA games, cinema-quality 3D worlds, and high-fidelity simulations without any fees or commercial obligations.

Open 3D Engine

Our Machinery Logo

The Machinery is a lightweight and flexible high-end 3D game engine made to be hacked. The plugin-based design lets you easily extend, tweak, or replace any part of the engine or editor.

Our Machinery

Source Logo

The Source Engine is a 3D game engine developed by Valve Corporation. Its unique features include a large degree of modularity and flexibility, an artist-driven, shader-based renderer, accurate lip sync and facial expression technology, and a powerful, efficient and completely network-enabled physics system.

Find out more

The Forge Logo

The-Forge is an open-source cross-platform rendering framework that is used to provide the rendering layer for custom next-gen game engines. It is also meant to provide building blocks to write your own game engine. It’s used by many different games and studios including but not limited to: Supergiant’s Hades, Bethesda’s Creation Engine, StarVR One SDK and others. The Forge Interactive offers game engine consulting and programming services around it.

The Forge

Xenko Logo

Open-source C# cross-platform game engine currently offering Vulkan support in Beta

Find out more

Unity Logo

Unity is the world’s leading platform for creating and operating real-time 3D (RT3D) content. Creators, ranging from game developers to artists, architects, automotive designers, filmmakers, and others, use Unity to make their imaginations come to life.

Find out more

Unreal Engine 4 Logo

Unreal Engine is the world’s most open and advanced real-time 3D creation tool. Continuously evolving to serve not only its original purpose as a state-of-the-art game engine, today it gives creators across industries the freedom and control to deliver cutting-edge content, interactive experiences, and immersive virtual worlds

Find out more

UX3D Logo

Cross-platform multi-threaded 3D rendering engine optimized for non-gaming industry

Find out more

Cocos Creator Engine Logo

Superb open source game and app development tool with bespoke content creation features. 2D and 3D game development has never been this easy.

Find out more

Vulkan Supported

Engines

Looking to take your project to the next level? Look no further: Here are several engines that currently support Vulkan.

Simplify, Prototype, Support

Frameworks and Helper Libraries

Want to simplify parts of your code or rapidly prototype an application? These frameworks and libraries can help.

Frameworks and Helper Libraries


Hades — Supergiant Games

Simplify, Prototype, Support

Frameworks and Helper Libraries

Want to simplify parts of your code or rapidly prototype an application? These frameworks and libraries can help.

  • Simple DirectMedia Layer (SDL) is a cross-platform library designed to provide a hardware abstraction layer for multimedia hardware components. Vulkan is now supported as a target rendering back-end.

    Find Out More

  • GLFW is an Open Source, multi-platform library for OpenGL, OpenGL ES and Vulkan application development providing a simple, platform-independent API for creating windows, contexts and surfaces, reading input, handling events, etc.

    Find Out More

  • Easy to integrate Vulkan memory allocation library to help developers to manage the complexity of Vulkan memory allocations and resource creation by offering higher-level functions to help allocate correct/optimal memory types.

    Find Out More

  • Dear ImGui is a bloat-free graphical user interface library for C++. It outputs optimized vertex buffers that you can render anytime in your 3D-pipeline enabled application. It is fast, portable, renderer agnostic and self-contained (no external dependencies).

    Find Out More

  • Cross-platform «Bring Your Own Engine/Framework» style rendering library

    Find Out More

  • bs::framework is a C++ library that aims to provide a unified foundation for the development of real-time graphical applications, whether games, engines or tools.

    Find Out More

  • flextGL is an OpenGL and Vulkan header/loader generator that gives complete control over exposed version and extensions.

    Find Out More

  • The Vulkan GLSL Ray Tracing Emulator is an online application that aims to simulate the ray tracing shader pipeline from the Vulkan GL EXT ray tracing specification.

    The web-based emulator is intended for computer graphics education or rapid prototyping of GLSL ray tracing shaders. It does not require a high-end GPU with special ray tracing hardware. Only if you want to run the exported C++ Vulkan stand-alone application, a GPU with ray tracing accelerator hardware is necessary.

    Find Out More

  • VulkanSceneGraph (VSG), is a modern, cross platform, high performance scene graph library built upon Vulkan graphics/compute API. The software is written in C++17, and follows the CppCoreGuidlines and FOSS Best Practices. The source code is published under the MIT License.

    Find Out More

  • ncnn is a high-performance neural network inference computing framework optimized for mobile platforms. ncnn does not have third party dependencies. Developers can easily deploy deep learning algorithm models to the mobile platform by using an efficient ncnn implementation, creating intelligent APPs, and bringing artificial intelligence to your fingertips.

    Find Out More

  • The general purpose GPU compute framework for cross vendor graphics cards. Kompute is backed by the Linux Foundation as a hosted project by the LF AI & Data Foundation.

    Find Out More

Work with Vulkan in the language of your choice

Language Bindings

Whilst C is the base language for Vulkan development there are a number of bindings for other languages if preferred or a project calls for it.

Language Bindings


Valheim — Iron Gate Studio

Work with Vulkan in the language of your choice

Language Bindings

Whilst C is the base language for Vulkan development there are a number of bindings for other languages if preferred or a project calls for it.

  • Vulkan-HPP provides header only C++ bindings for the Vulkan C API to improve the developers Vulkan experience without introducing CPU runtime cost. It adds features like type safety for enums and bitfields, STL container support, exceptions and simple enumerations.

    Find Out More

  • Ash provides a lightweight wrapper around Vulkan for Rust.

    Find Out More

  • Vortice.Vulkan is a .NET Standard 2.0 and .NET5 low-level binding for the Vulkan API.

    Find Out More

  • nvk is a low-abstraction, high-performance Vulkan API with interfaces for JavaScript and TypeScript.

    Find Out More

  • Slightly high level Haskell bindings to the Vulkan graphics API and the Vulkan Memory Allocator. These bindings present an interface to Vulkan which looks like more idiomatic Haskell and which is much less verbose than the C API.

    Find Out More

  • Vulkan 1.2 API integration and utilities for Racket providing a faithful replication of the raw Vulkan API with powerful code generators and all platform bindings exposed.

    Find Out More

  • LWJGL is a Java library that enables cross-platform access to popular native APIs useful in the development of graphics (OpenGL, Vulkan), audio (OpenAL) and parallel computing (OpenCL) applications. This access is direct and high-performance, yet also wrapped in a type-safe and user-friendly layer, appropriate for the Java ecosystem.

    Find Out More

Reducing Fragmentation

Vulkan Profiles

Vulkan Profiles provide a way to precisely communicate functionality requirements and device capabilities between participants in the Vulkan ecosystem to streamline the development and deployment of portable applications. The new mechanism enables the precise specification and management of sets of API capabilities including a core version plus a set of required extensions, supported limits, features, and formats.

Vulkan Profiles

Reducing Fragmentation

Vulkan Profiles

Vulkan Profiles provide a way to precisely communicate functionality requirements and device capabilities between participants in the Vulkan ecosystem to streamline the development and deployment of portable applications. The new mechanism enables the precise specification and management of sets of API capabilities including a core version plus a set of required extensions, supported limits, features, and formats.

  • With Vulkan 1.3 and the new public roadmap, we’re taking a significant step to reduce feature fragmentation

    Find Out More

  • LunarG has published a white paper that explains the new Vulkan Profiles Toolset Solution

    Find Out More

  • The Vulkan Profiles Toolset is a collection of components for Vulkan application developers to build portable Vulkan applications using Vulkan Profiles

    Find Out More

  • In this blog post, Android developers discuss Baseline Profiles and how they improve app and library performance, including startup time

    Find Out More

  • gpuinfo.org is the community-driven Vulkan hardware database, an online tool for developers to get details about GPU hardware capabilites (supports export to .JSON format for use with Vulkan Profiles)

    gpuinfo.org

  • Windows

    • Vulkan SDK

    • GLFW

    • GLM

    • Setting up Visual Studio

  • Linux

    • Vulkan Packages

    • GLFW

    • GLM

    • Shader Compiler

    • Setting up a makefile project

  • MacOS

    • Vulkan SDK

    • GLFW

    • GLM

    • Setting up Xcode

In this chapter we’ll set up your environment for developing Vulkan applications
and install some useful libraries. All of the tools we’ll use, with the
exception of the compiler, are compatible with Windows, Linux and MacOS, but the
steps for installing them differ a bit, which is why they’re described
separately here.

Windows

If you’re developing for Windows, then I will assume that you are using Visual
Studio to compile your code. For complete C++17 support, you need to use either
Visual Studio 2017 or 2019. The steps outlined below were written for VS 2017.

Vulkan SDK

The most important component you’ll need for developing Vulkan applications is
the SDK. It includes the headers, standard validation layers, debugging tools
and a loader for the Vulkan functions. The loader looks up the functions in the
driver at runtime, similarly to GLEW for OpenGL — if you’re familiar with that.

The SDK can be downloaded from the LunarG website
using the buttons at the bottom of the page. You don’t have to create an
account, but it will give you access to some additional documentation that may
be useful to you.

Proceed through the installation and pay attention to the install location of
the SDK. The first thing we’ll do is verify that your graphics card and driver
properly support Vulkan. Go to the directory where you installed the SDK, open
the Bin directory and run the vkcube.exe demo. You should see the following:

If you receive an error message then ensure that your drivers are up-to-date,
include the Vulkan runtime and that your graphics card is supported. See the
introduction chapter for links to drivers from the major
vendors.

There is another program in this directory that will be useful for development. The glslangValidator.exe and glslc.exe programs will be used to compile shaders from the
human-readable GLSL to
bytecode. We’ll cover this in depth in the shader modules
chapter. The Bin directory also contains the binaries of the Vulkan loader
and the validation layers, while the Lib directory contains the libraries.

Lastly, there’s the Include directory that contains the Vulkan headers. Feel free to explore the other files, but we won’t need them for this tutorial.

GLFW

As mentioned before, Vulkan by itself is a platform agnostic API and does not
include tools for creating a window to display the rendered results. To benefit
from the cross-platform advantages of Vulkan and to avoid the horrors of Win32,
we’ll use the GLFW library to create a window, which
supports Windows, Linux and MacOS. There are other libraries available for this
purpose, like SDL, but the advantage of GLFW is that
it also abstracts away some of the other platform-specific things in Vulkan
besides just window creation.

You can find the latest release of GLFW on the official website.
In this tutorial we’ll be using the 64-bit binaries, but you can of course also
choose to build in 32 bit mode. In that case make sure to link with the Vulkan
SDK binaries in the Lib32 directory instead of Lib. After downloading it, extract the archive
to a convenient location. I’ve chosen to create a Libraries directory in the
Visual Studio directory under documents.

GLM

Unlike DirectX 12, Vulkan does not include a library for linear algebra
operations, so we’ll have to download one. GLM is a
nice library that is designed for use with graphics APIs and is also commonly
used with OpenGL.

GLM is a header-only library, so just download the latest version
and store it in a convenient location. You should have a directory structure
similar to the following now:

Setting up Visual Studio

Now that you’ve installed all of the dependencies we can set up a basic Visual
Studio project for Vulkan and write a little bit of code to make sure that
everything works.

Start Visual Studio and create a new Windows Desktop Wizard project by entering a name and pressing OK.

Make sure that Console Application (.exe) is selected as application type so that we have a place to print debug messages to, and check Empty Project to prevent Visual Studio from adding boilerplate code.

Press OK to create the project and add a C++ source file. You should
already know how to do that, but the steps are included here for completeness.

Now add the following code to the file. Don’t worry about trying to
understand it right now; we’re just making sure that you can compile and run
Vulkan applications. We’ll start from scratch in the next chapter.

#define GLFW_INCLUDE_VULKAN
#include <GLFW/glfw3.h>

#define GLM_FORCE_RADIANS
#define GLM_FORCE_DEPTH_ZERO_TO_ONE
#include <glm/vec4.hpp>
#include <glm/mat4x4.hpp>

#include <iostream>

int main() {
    glfwInit();

    glfwWindowHint(GLFW_CLIENT_API, GLFW_NO_API);
    GLFWwindow* window = glfwCreateWindow(800, 600, "Vulkan window", nullptr, nullptr);

    uint32_t extensionCount = 0;
    vkEnumerateInstanceExtensionProperties(nullptr, &extensionCount, nullptr);

    std::cout << extensionCount << " extensions supportedn";

    glm::mat4 matrix;
    glm::vec4 vec;
    auto test = matrix * vec;

    while(!glfwWindowShouldClose(window)) {
        glfwPollEvents();
    }

    glfwDestroyWindow(window);

    glfwTerminate();

    return 0;
}

Let’s now configure the project to get rid of the errors. Open the project
properties dialog and ensure that All Configurations is selected, because most
of the settings apply to both Debug and Release mode.

Go to C++ -> General -> Additional Include Directories and press <Edit...>
in the dropdown box.

Add the header directories for Vulkan, GLFW and GLM:

Next, open the editor for library directories under Linker -> General:

And add the locations of the object files for Vulkan and GLFW:

Go to Linker -> Input and press <Edit...> in the Additional Dependencies
dropdown box.

Enter the names of the Vulkan and GLFW object files:

And finally change the compiler to support C++17 features:

You can now close the project properties dialog. If you did everything right
then you should no longer see any more errors being highlighted in the code.

Finally, ensure that you are actually compiling in 64 bit mode:

Press F5 to compile and run the project and you should see a command prompt
and a window pop up like this:

The number of extensions should be non-zero. Congratulations, you’re all set for
playing with Vulkan!

Linux

These instructions will be aimed at Ubuntu, Fedora and Arch Linux users, but you may be able to follow
along by changing the package manager-specific commands to the ones that are appropriate for you. You should have a compiler that supports C++17 (GCC 7+ or Clang 5+). You’ll also need make.

Vulkan Packages

The most important components you’ll need for developing Vulkan applications on Linux are the Vulkan loader, validation layers, and a couple of command-line utilities to test whether your machine is Vulkan-capable:

  • sudo apt install vulkan-tools or sudo dnf install vulkan-tools: Command-line utilities, most importantly vulkaninfo and vkcube. Run these to confirm your machine supports Vulkan.
  • sudo apt install libvulkan-dev or sudo dnf install vulkan-loader-devel : Installs Vulkan loader. The loader looks up the functions in the driver at runtime, similarly to GLEW for OpenGL — if you’re familiar with that.
  • sudo apt install vulkan-validationlayers-dev spirv-tools or sudo dnf install mesa-vulkan-devel vulkan-validation-layers-devel: Installs the standard validation layers and required SPIR-V tools. These are crucial when debugging Vulkan applications, and we’ll discuss them in the upcoming chapter.

On Arch Linux, you can run sudo pacman -S vulkan-devel to install all the
required tools above.

If installation was successful, you should be all set with the Vulkan portion. Remember to run
vkcube and ensure you see the following pop up in a window:

If you receive an error message then ensure that your drivers are up-to-date,
include the Vulkan runtime and that your graphics card is supported. See the
introduction chapter for links to drivers from the major
vendors.

GLFW

As mentioned before, Vulkan by itself is a platform agnostic API and does not
include tools for creation a window to display the rendered results. To benefit
from the cross-platform advantages of Vulkan and to avoid the horrors of X11,
we’ll use the GLFW library to create a window, which
supports Windows, Linux and MacOS. There are other libraries available for this
purpose, like SDL, but the advantage of GLFW is that
it also abstracts away some of the other platform-specific things in Vulkan
besides just window creation.

We’ll be installing GLFW from the following command:

sudo apt install libglfw3-dev

or

sudo dnf install glfw-devel

or

sudo pacman -S glfw-wayland # glfw-x11 for X11 users

GLM

Unlike DirectX 12, Vulkan does not include a library for linear algebra
operations, so we’ll have to download one. GLM is a
nice library that is designed for use with graphics APIs and is also commonly
used with OpenGL.

It is a header-only library that can be installed from the libglm-dev or
glm-devel package:

sudo apt install libglm-dev

or

sudo dnf install glm-devel

or

sudo pacman -S glm

Shader Compiler

We have just about all we need, except we’ll want a program to compile shaders from the human-readable GLSL to bytecode.

Two popular shader compilers are Khronos Group’s glslangValidator and Google’s glslc. The latter has a familiar GCC- and Clang-like usage, so we’ll go with that: on Ubuntu, download Google’s unofficial binaries and copy glslc to your /usr/local/bin. Note you may need to sudo depending on your permissions. On Fedora use sudo dnf install glslc, while on Arch Linux run sudo pacman -S shaderc. To test, run glslc and it should rightfully complain we didn’t pass any shaders to compile:

glslc: error: no input files

We’ll cover glslc in depth in the shader modules chapter.

Setting up a makefile project

Now that you have installed all of the dependencies, we can set up a basic
makefile project for Vulkan and write a little bit of code to make sure that
everything works.

Create a new directory at a convenient location with a name like VulkanTest.
Create a source file called main.cpp and insert the following code. Don’t
worry about trying to understand it right now; we’re just making sure that you
can compile and run Vulkan applications. We’ll start from scratch in the next
chapter.

#define GLFW_INCLUDE_VULKAN
#include <GLFW/glfw3.h>

#define GLM_FORCE_RADIANS
#define GLM_FORCE_DEPTH_ZERO_TO_ONE
#include <glm/vec4.hpp>
#include <glm/mat4x4.hpp>

#include <iostream>

int main() {
    glfwInit();

    glfwWindowHint(GLFW_CLIENT_API, GLFW_NO_API);
    GLFWwindow* window = glfwCreateWindow(800, 600, "Vulkan window", nullptr, nullptr);

    uint32_t extensionCount = 0;
    vkEnumerateInstanceExtensionProperties(nullptr, &extensionCount, nullptr);

    std::cout << extensionCount << " extensions supportedn";

    glm::mat4 matrix;
    glm::vec4 vec;
    auto test = matrix * vec;

    while(!glfwWindowShouldClose(window)) {
        glfwPollEvents();
    }

    glfwDestroyWindow(window);

    glfwTerminate();

    return 0;
}

Next, we’ll write a makefile to compile and run this basic Vulkan code. Create a
new empty file called Makefile. I will assume that you already have some basic
experience with makefiles, like how variables and rules work. If not, you can
get up to speed very quickly with this tutorial.

We’ll first define a couple of variables to simplify the remainder of the file.
Define a CFLAGS variable that will specify the basic compiler flags:

CFLAGS = -std=c++17 -O2

We’re going to use modern C++ (-std=c++17), and we’ll set optimization level to O2. We can remove -O2 to compile programs faster, but we should remember to place it back for release builds.

Similarly, define the linker flags in a LDFLAGS variable:

LDFLAGS = -lglfw -lvulkan -ldl -lpthread -lX11 -lXxf86vm -lXrandr -lXi

The flag -lglfw is for GLFW, -lvulkan links with the Vulkan function loader and the remaining flags are low-level system libraries that GLFW needs. The remaining flags are dependencies of GLFW itself: the threading and window management.

It is possible that the Xxf68vm and Xi libraries are not yet installed on your system. You can find them in the following packages:

sudo apt install libxxf86vm-dev libxi-dev

or

sudo dnf install libXi-devel libXxf86vm-devel

or

sudo pacman -S libxi libxxf86vm

Specifying the rule to compile VulkanTest is straightforward now. Make sure to
use tabs for indentation instead of spaces.

VulkanTest: main.cpp
    g++ $(CFLAGS) -o VulkanTest main.cpp $(LDFLAGS)

Verify that this rule works by saving the makefile and running make in the
directory with main.cpp and Makefile. This should result in a VulkanTest
executable.

We’ll now define two more rules, test and clean, where the former will
run the executable and the latter will remove a built executable:

.PHONY: test clean

test: VulkanTest
    ./VulkanTest

clean:
    rm -f VulkanTest

Running make test should show the program running successfully, and displaying the number of Vulkan extensions. The application should exit with the success return code (0) when you close the empty window. You should now have a complete makefile that resembles the following:

CFLAGS = -std=c++17 -O2
LDFLAGS = -lglfw -lvulkan -ldl -lpthread -lX11 -lXxf86vm -lXrandr -lXi

VulkanTest: main.cpp
    g++ $(CFLAGS) -o VulkanTest main.cpp $(LDFLAGS)

.PHONY: test clean

test: VulkanTest
	./VulkanTest

clean:
    rm -f VulkanTest

You can now use this directory as a template for your Vulkan projects. Make a copy, rename it to something like HelloTriangle and remove all of the code in main.cpp.

You are now all set for the real adventure.

MacOS

These instructions will assume you are using Xcode and the Homebrew package manager. Also, keep in mind that you will need at least MacOS version 10.11, and your device needs to support the Metal API.

Vulkan SDK

The most important component you’ll need for developing Vulkan applications is the SDK. It includes the headers, standard validation layers, debugging tools and a loader for the Vulkan functions. The loader looks up the functions in the driver at runtime, similarly to GLEW for OpenGL — if you’re familiar with that.

The SDK can be downloaded from the LunarG website using the buttons at the bottom of the page. You don’t have to create an account, but it will give you access to some additional documentation that may be useful to you.

The SDK version for MacOS internally uses MoltenVK. There is no native support for Vulkan on MacOS, so what MoltenVK does is actually act as a layer that translates Vulkan API calls to Apple’s Metal graphics framework. With this you can take advantage of debugging and performance benefits of Apple’s Metal framework.

After downloading it, simply extract the contents to a folder of your choice (keep in mind you will need to reference it when creating your projects on Xcode). Inside the extracted folder, in the Applications folder you should have some executable files that will run a few demos using the SDK. Run the vkcube executable and you will see the following:

GLFW

As mentioned before, Vulkan by itself is a platform agnostic API and does not include tools for creation a window to display the rendered results. We’ll use the GLFW library to create a window, which supports Windows, Linux and MacOS. There are other libraries available for this purpose, like SDL, but the advantage of GLFW is that it also abstracts away some of the other platform-specific things in Vulkan besides just window creation.

To install GLFW on MacOS we will use the Homebrew package manager to get the glfw package:

brew install glfw

GLM

Vulkan does not include a library for linear algebra operations, so we’ll have to download one. GLM is a nice library that is designed for use with graphics APIs and is also commonly used with OpenGL.

It is a header-only library that can be installed from the glm package:

brew install glm

Setting up Xcode

Now that all the dependencies are installed we can set up a basic Xcode project for Vulkan. Most of the instructions here are essentially a lot of «plumbing» so we can get all the dependencies linked to the project. Also, keep in mind that during the following instructions whenever we mention the folder vulkansdk we are refering to the folder where you extracted the Vulkan SDK.

Start Xcode and create a new Xcode project. On the window that will open select Application > Command Line Tool.

Select Next, write a name for the project and for Language select C++.

Press Next and the project should have been created. Now, let’s change the code in the generated main.cpp file to the following code:

#define GLFW_INCLUDE_VULKAN
#include <GLFW/glfw3.h>

#define GLM_FORCE_RADIANS
#define GLM_FORCE_DEPTH_ZERO_TO_ONE
#include <glm/vec4.hpp>
#include <glm/mat4x4.hpp>

#include <iostream>

int main() {
    glfwInit();

    glfwWindowHint(GLFW_CLIENT_API, GLFW_NO_API);
    GLFWwindow* window = glfwCreateWindow(800, 600, "Vulkan window", nullptr, nullptr);

    uint32_t extensionCount = 0;
    vkEnumerateInstanceExtensionProperties(nullptr, &extensionCount, nullptr);

    std::cout << extensionCount << " extensions supportedn";

    glm::mat4 matrix;
    glm::vec4 vec;
    auto test = matrix * vec;

    while(!glfwWindowShouldClose(window)) {
        glfwPollEvents();
    }

    glfwDestroyWindow(window);

    glfwTerminate();

    return 0;
}

Keep in mind you are not required to understand all this code is doing yet, we are just setting up some API calls to make sure everything is working.

Xcode should already be showing some errors such as libraries it cannot find. We will now start configuring the project to get rid of those errors. On the Project Navigator panel select your project. Open the Build Settings tab and then:

  • Find the Header Search Paths field and add a link to /usr/local/include (this is where Homebrew installs headers, so the glm and glfw3 header files should be there) and a link to vulkansdk/macOS/include for the Vulkan headers.
  • Find the Library Search Paths field and add a link to /usr/local/lib (again, this is where Homebrew installs libraries, so the glm and glfw3 lib files should be there) and a link to vulkansdk/macOS/lib.

It should look like so (obviously, paths will be different depending on where you placed on your files):

Now, in the Build Phases tab, on Link Binary With Libraries we will add both the glfw3 and the vulkan frameworks. To make things easier we will be adding the dynamic libraries in the project (you can check the documentation of these libraries if you want to use the static frameworks).

  • For glfw open the folder /usr/local/lib and there you will find a file name like libglfw.3.x.dylib («x» is the library’s version number, it might be different depending on when you downloaded the package from Homebrew). Simply drag that file to the Linked Frameworks and Libraries tab on Xcode.
  • For vulkan, go to vulkansdk/macOS/lib. Do the same for the both files libvulkan.1.dylib and libvulkan.1.x.xx.dylib (where «x» will be the version number of the the SDK you downloaded).

After adding those libraries, in the same tab on Copy Files change Destination to «Frameworks», clear the subpath and deselect «Copy only when installing». Click on the «+» sign and add all those three frameworks here aswell.

Your Xcode configuration should look like:

The last thing you need to setup are a couple of environment variables. On Xcode toolbar go to Product > Scheme > Edit Scheme..., and in the Arguments tab add the two following environment variables:

  • VK_ICD_FILENAMES = vulkansdk/macOS/share/vulkan/icd.d/MoltenVK_icd.json
  • VK_LAYER_PATH = vulkansdk/macOS/share/vulkan/explicit_layer.d

It should look like so:

Finally, you should be all set! Now if you run the project (remembering to setting the build configuration to Debug or Release depending on the configuration you chose) you should see the following:

The number of extensions should be non-zero. The other logs are from the libraries, you might get different messages from those depending on your configuration.

You are now all set for the real thing.

Vulkan Ecosystem Tools

The repository contains the following Vulkan Tools:

  • Vulkan Configurator
  • VK_LAYER_LUNARG_api_dump, VK_LAYER_LUNARG_screenshot and VK_LAYER_LUNARG_monitor layers
  • Vulkan Installation Analyzer

These tools have binaries included within the Vulkan SDK.

VkTrace and VkReplay have been deprecated and replaced by gfxreconstruct.
Both VkTrace and VkReplay have been removed from VulkanTools and can now be found in the vktrace archive.
Both these tools are also no longer part of the Vulkan SDK.

Default branch changed to ‘main’ 2023-01-17

The default branch of this repository is now ‘main’. This change should be largely transparent to repository users, since github rewrites many references to the old ‘master’ branch to ‘main’. However, if you have a checked-out local clone, you may wish to take the following steps as recommended by github:

git branch -m master main
git fetch origin
git branch -u origin/main main
git remote set-head origin -a

CI Build Status

Build Status
Build Status
Build Status
Build Status
Build Status

Contributing

If you intend to contribute, the preferred work flow is for you to develop your contribution
in a fork of this repo in your GitHub account and then submit a pull request.
Please see the CONTRIBUTING file in this repository for more details

How to Build and Run

BUILD.md includes directions for building all the components and running the tests.

Version Tagging Scheme

Updates to the LunarG-VulkanTools repository which correspond to a new Vulkan specification release are tagged using the following format: v<version> (e.g., v1.1.96).

Note: Marked version releases have undergone thorough testing but do not imply the same quality level as SDK tags. SDK tags follow the sdk-<version>.<patch> format (e.g., sdk-1.1.92.0).

This scheme was adopted following the 1.1.96 Vulkan specification release.

License

This work is released as open source under a Apache-style license from Khronos including a Khronos copyright.

Acknowledgements

While this project has been developed primarily by LunarG, Inc., there are many other companies and individuals making this possible: Valve Corporation, funding project development.

Понравилась статья? Поделить с друзьями:
  • Vulkan 1 dll скачать 64 bit windows 7 скачать бесплатно
  • Vulkan 1 dll скачать 64 bit windows 7 для doom
  • Vulkan 1 dll скачать 64 bit windows 10 скачать торрент
  • Vulkan 1 dll скачать 64 bit windows 10 официальный сайт
  • Vulkan 1 dll скачать 64 bit windows 10 как установить