Try vulkan on windows

0x1 Vulkan简介

Vulkan是轻量级、更贴近底层硬件的接口,可使GPU驱动程序充分利用多核CPU性能.

对于CPU处理是瓶颈的3D场景,采用Vulkan能提升性能.

Vulkan可以节省shader编译的时间,因为Vulkan只需要处理SPIR-V中间代码.

Vulkan不负责内存的管理,多线程的管理和并发访问保护,由应用程序去负责这些工作.

下面介绍一下如何在Windows下编译和测试Vulkan,显卡是Intel HD Graphics 520.

0x2 安装支持Vulkan的graphics驱动

下载并安装最新的graphics驱动

https://communities.intel.com/external-link.jspa?url=https%3A%2F%2Fdownloadmirror.intel.com%2F26563%2Feng%2Fwin64_154514.4590.zip

0x3 安装Lunarg Vulkan SDK

下载地址如下

https://vulkan.lunarg.com/sdk/home#sdk/downloadConfirm/1.0.51.0/windows/VulkanSDK-1.0.51.0-Installer.exe

0x4 安装Vulkan Hardware Capability Viewer

用于查看系统中vulkan支持信息

可执行程序如下

http://vulkan.gpuinfo.org/downloads/vulkancapsviewer_1_4_win64.zip

代码如下

https://github.com/SaschaWillems/VulkanCapsViewer

运行效果如下

vulkan1

0x5 编译运行Vulkan demo

代码如下

https://github.com/GameTechDev/stardust_vulkan

运行效果如下

vulkan2

下载gpu-z,查看gpu使用情况

https://www.techpowerup.com/download/techpowerup-gpu-z/

从gpu-z的使用情况可知,gpu一直很忙,说明vulkan已经工作

vulkan3

0x6 编译运行Vulkan example

测试代码如下

https://github.com/SaschaWillems/Vulkan

运行效果如下

vulkan4

0x7 Vulkan Architecture on Windows

vulkan5

vulkan-1.dll, The Vulkan loader.

ig9icd64.dll/igc64.dll/igvk64.dll, Intel vulkan driver.

0x8 Vulkan Architecture on Android

vulkan6

libvulkan.so

Android vulkan HAL library, this library will load IHV’s vulkan library in /system/lib/hw automatically, application will load this library then map vulkan api call to IHV’s vulkan driver library.

vulkan.xxx.so

IHV’s vulkan driver library, it supports SPIR-V shader input, and implements vulkan API, will trigger GPU HW to do acutal graphics processing.