Questions tagged [vulkan]

Vulkan is a low-overhead, cross-platform graphics API from the Khronos Group.

Vulkan, once known as Next Generation OpenGL or just GLnext, is designed to be a low-overhead API that facilitates multithreaded 3D development, enabling different CPU threads to simultaneously prepare batches of commands to send to the GPU. It gives developers greater control of generating commands, putting tasks such as memory and thread management in their hands rather than relying on video drivers to handle these responsibilities. In so doing, it greatly reduces the amount of work and validation that the driver must perform, thus drastically reducing driver complexity. Conversely it increases the responsibilities of the application / developer to ensure that operations are valid and properly synchronized with each other.

Vulkan uses SPIR-V bytecode as its standard representation for graphics and compute shaders. The Khronos reference GLSL compiler compiles a form of GLSL (which implements a special extension to support Vulkan features) into SPIR-V, but users can use whatever compilers they wish which have a SPIR-V backend. The SPIR-V ecosystem also includes support for compiling from other languages such as HLSL, and for cross compiling SPIR-V bytecode back into various languages, including GLSL, HLSL and C++.

Vulkan enjoys wide native platform support on Windows, Linux, & Android. Additionally, a large subset of Vulkan is supported on the iOS and MacOS platforms through MoltenVk, part of the Vulkan Portability Initiative. Additional work is being done to develop a similar implementation of Vulkan over D3D12 to allow it to be used on UWP platforms that might not have native Vulkan drivers.

2248 questions
9
votes
1 answer

Unable to create image from compressed texture data (S3TC)

I've been trying to load compressed images with S3TC (BC/DXT) compression in Vulkan, but so far I haven't had much luck. Here is what the Vulkan specification says about compressed…
Silverlan
  • 2,783
  • 3
  • 31
  • 66
9
votes
4 answers

How do I use Vulkan with MinGW? (R_X86_64_32 error)

I am trying to setup a bare bones program to use Vulkan. I installed the LunarG SDK. I have a tiny program that basically just calls vkCreateInstance. I compiled with this line: g++ -std=c++11 -I/c/VulkanSDK/1.0.3.1/Include…
TheBuzzSaw
  • 8,648
  • 5
  • 39
  • 58
9
votes
2 answers

Vulkan: difference between vkGetInstanceProcAddress and vkGetDeviceProcAddress

vkGetInstanceProcAddr and vkGetDeviceProcAddr are completely missing from the API documentation. However they are required to perform commands with swapchains (and thus make any meaningful Vulkan app). Furthermore, the cube/tri demos that come with…
MuertoExcobito
  • 9,741
  • 2
  • 37
  • 78
8
votes
0 answers

vulkaninfo failed to work in docker and did not recognize NVIDIA GPU

Problem description When I run vulkaninfo in docker, it complains: Cannot create Vulkan instance. This problem is often caused by a faulty installation of the Vulkan driver or attempting to use a GPU that does not support Vulkan. ERROR at…
f1shel
  • 81
  • 5
8
votes
1 answer

vkEnumeratePhysicalDevices() not finding all GPUs

My system has the following specs: GPUs: AMD Radeon(TM) Graphics NVIDIA GeForce RTX 2060 with Max-Q Design CPU: AMD Ryzen 9 4900HS with Radeon Graphics When I run vkEnumeratePhysicalDevices() it only returns 1 device, my integrated graphics (AMD…
Braden Yonano
  • 161
  • 2
  • 12
8
votes
2 answers

Vulkan validation warning catch-22 about VK_KHR_portability_subset on MoltenVK

I'm using Vulkan 1.2.170 with MoltenVK (and GLFW) on Big Sur (mid 2014 15" Retina). I created the instance with VK_LAYER_KHRONOS_validation and when I call vkCreateDevice I get the warning VUID-VkDeviceCreateInfo-pProperties-04451(ERROR / SPEC):…
Dan
  • 12,409
  • 3
  • 50
  • 87
8
votes
1 answer

Why does vkAcquireNextImageKHR() never block my thread?

I am using Vulkan graphics API (via BGFX) to render. And I have been measuring how much (wall-clock) time my calls take. What I do not understand is that vkAcquireNextImageKHR() is always fast, and never blocks. Even though I disable the time-out…
Bram
  • 7,440
  • 3
  • 52
  • 94
8
votes
1 answer

Synchronizing vertex buffer in vulkan?

I have a vertex buffer that is stored in a device memory and a buffer and is host visible and host coherent. To write to the vertex buffer on the host side I map it, memcpy to it and unmap the device memory. To read from it I bind the vertex buffer…
Andrew Tomazos
  • 66,139
  • 40
  • 186
  • 319
8
votes
2 answers

What's the correct way to implement "Instanced rendering" in Vulkan?

I'm currently trying to render multiple cubes efficiently, so I'd like to know how to use this "Instanced Rendering" in Vulkan. I currently know of only 2 ways of rendering a lot of (identical) objects: 1) Multiple DescriptorSets; 2) Single…
ShockCoding
  • 216
  • 2
  • 12
8
votes
1 answer

Why does vulkan report a single device in a system with an integrated graphics card and a GPU?

In C++ I am checking the number of available devices like this: uint32_t deviceCount = 0; vkEnumeratePhysicalDevices(instance, &deviceCount, nullptr); cout << deviceCount << endl; vkGetPhysicalDeviceProperties(device,…
Makogan
  • 8,208
  • 7
  • 44
  • 112
8
votes
1 answer

What exactly is VK_SUBPASS_EXTERNAL?

I was recently learning the Vulkan API but just cannot understand what VK_SUBPASS_EXTERNAL (assigned to VkSubpassDependency::srcSubpass or VkSubpassDependency::dstSubpass) means. The official documentation states: "If srcSubpass is equal to…
ph3rin
  • 4,426
  • 1
  • 18
  • 42
8
votes
0 answers

Disabling an implicit layer during development

My development machine has Steam installed on it, which installed SteamOverlayVulkanLayer64 as an implicit layer. This is all fine and dandy, but it seems a recent update made a change that made it incompatible with LunarG's VKLayer_unique_objects.…
user4442671
8
votes
1 answer

Is there an alternative to OpenCL+PyOpenCL for multiplatform GPGPU compute?

Support for OpenCL on Macs is going to end in macOS 10.15, so people invested in PyOpenCL+OpenCL as a means for doing general-purpose GPU (+CPU) compute will soon start to lose a key platform. So my questions are: Are there any viable…
Colin Stark
  • 301
  • 1
  • 10
8
votes
1 answer

What is the purpose of VkAttachmentReference::layout?

I'm trying to understand why we need VkAttachmentReference::layout? Documentation says: layout is a VkImageLayout value specifying the layout the attachment uses during the subpass. In other words it tells to which layout the attachment will…
nikitablack
  • 4,359
  • 2
  • 35
  • 68
8
votes
1 answer

Can Vulkan specialization constants be expressed in GLSL?

I've been using Vulkan for a while but I just now learned about specialization constants. The specification says: Specialization constants are useful to allow a compute shader to have its local workgroup size changed at runtime by the user, for…
mjwach
  • 1,174
  • 2
  • 9
  • 25