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
19
votes
1 answer

Using different push-constants in different shader stages

I have a vertex shader with a push-constant block containing one float: layout(push_constant) uniform pushConstants { float test1; } u_pushConstants; And a fragment shader with another push-constant block with a different float…
Silverlan
  • 2,783
  • 3
  • 31
  • 66
17
votes
1 answer

What is the difference between normalized, scaled and integer VkFormats?

Let's take the following 6 VkFormats for example: VK_FORMAT_R8_UNORM VK_FORMAT_R8_SNORM VK_FORMAT_R8_USCALED VK_FORMAT_R8_SSCALED VK_FORMAT_R8_UINT VK_FORMAT_R8_SINT All of these specify a one-component 8-bit format that has a single 8-bit R…
Andrew Tomazos
  • 66,139
  • 40
  • 186
  • 319
17
votes
2 answers

What is the purpose of Vulkan's new extension VK_KHR_vulkan_memory_model?

Khronos just released their new memory model extension, but there is yet to be an informal discussion, example implementation, etc. so I am confused about the basic…
RWilco8
  • 251
  • 5
  • 17
17
votes
1 answer

Vulkan - draw texture directly without vertices and shaders

Is it possible to draw texture (if it is with correct width, height and pixel format) directly to frame buffer without using vertices and shaders in Vulkan?
zedrian
  • 296
  • 3
  • 10
17
votes
1 answer

What is the point of VkApplicationInfo?

In the new Vulkan API, there is a struct which is needed to create a VkInstance: VkApplicationInfo. Here's the definition: typedef struct VkApplicationInfo { VkStructureType sType; const void* pNext; const char* …
Jerfov2
  • 5,264
  • 5
  • 30
  • 52
17
votes
1 answer

Could someone help me understand VkPhysicalDeviceMemoryProperties?

I'm trying to figure it out, but I'm getting a little stuck. The way the types and heaps are related is simple, if a bit strange. (why not just give VkMemoryHeap a VkMemoryType member?) I think I understand what all the VkMemoryPropertyFlags mean,…
AlphaModder
  • 3,266
  • 2
  • 28
  • 44
16
votes
4 answers

Android emulator Failed to create Vulkan instance

When creating new Android emulator in Ubuntu shows following error, does this affect my vulkan game development? queryCoreProfileSupport: swap interval not found emulator: ERROR: VkCommonOperations.cpp:496: Failed to create Vulkan…
Ebin Joy
  • 2,690
  • 5
  • 26
  • 39
16
votes
2 answers

Vulkan failing to clear depth

I've been working with Vulkan for the past couple weeks and I've run into a problem that has only been happening on AMD cards. Specifically the AMD 7970M. I've ran my project on GTX 700 and 900 series cards with no problem. I've even ran on Windows…
Honeybunch
  • 577
  • 5
  • 17
15
votes
1 answer

What is the relationship of RenderPass and Pipeline in Vulkan?

What is the logical relationship between RenderPass and Pipeline in Vulkan? If you ignore RenderPass, my understanding of the rendering process is first, the vertex data prepared by the application layer, then the texture data can be submitted to…
董佳斌
  • 151
  • 1
  • 3
14
votes
1 answer

How do UBOs/SSBOs differ from Vulkan's shader memory bindings?

In the article on Imagination's website, I've read the following paragraph: For example, there are no glUniform*() equivalent entry points in Vulkan; instead, writing to GPU memory is the only way to pass data to shaders. When you call…
Bartek Banachewicz
  • 38,596
  • 7
  • 91
  • 135
13
votes
2 answers

Execute a bat file on keypress in VsCode

I'm writing shaders for vulkan, which have to be compiled into spir-v. I have a very nice batch file that will go through and build my shaders for me using the GLSlangvalidator. I'm trying to get a keypress to run my batch file in VsCode so I can…
Figwig
  • 592
  • 1
  • 3
  • 16
13
votes
1 answer

Enabling VSync in Vulkan

How do I use vsync in Vulkan? I'm on Windows, but the code should also work on Linux. Is it implemented by inserting a fence in vkAcquireNextImageKHR?
SurvivalMachine
  • 7,946
  • 15
  • 57
  • 87
12
votes
1 answer

Use Vulkan VkImage as a CUDA cuArray

What is the correct way of using a Vulkan VkImage as a CUDA cuArray? I've been trying to follow some examples, however I get a CUDA_ERROR_INVALID_VALUE on a call to cuExternalMemoryGetMappedMipmappedArray() To provide the information in an ordered…
jsantander
  • 4,972
  • 16
  • 27
12
votes
1 answer

Why do we need SPIR-V?

I have been reading about heterogeneous computing and came across SPIR-V. There I found the following: SPIR-V is the first open standard, cross-API intermediate language for natively representing parallel compute and graphics.. From this image I…
Dimitar Hristov
  • 123
  • 1
  • 7
12
votes
1 answer

Flipping the viewport in Vulkan

From the spec: VK_KHR_maintenance1 Allow negative height to be specified in the slink::VkViewport::height field to perform y-inversion of the clip-space to framebuffer-space transform. This allows apps to avoid having to use gl_Position.y =…
hidayat
  • 9,493
  • 13
  • 51
  • 66