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
65
votes
2 answers

Rendering meshes with multiple indices

I have some vertex data. Positions, normals, texture coordinates. I probably loaded it from a .obj file or some other format. Maybe I'm drawing a cube. But each piece of vertex data has its own index. Can I render this mesh data using…
Nicol Bolas
  • 449,505
  • 63
  • 781
  • 982
51
votes
1 answer

Should I ever use a `vec3` inside of a uniform buffer or shader storage buffer object?

The vec3 type is a very nice type. It only takes up 3 floats, and I have data that only needs 3 floats. And I want to use one in a structure in a UBO and/or SSBO: layout(std140) uniform UBO { vec4 data1; vec3 data2; float…
Nicol Bolas
  • 449,505
  • 63
  • 781
  • 982
40
votes
2 answers

What is actually a Queue family in Vulkan?

I am currently learning vulkan, right now I am just taking apart each command and inspecting the structures to try to understand what they mean. Right now I am analyzing QueueFamilies, for which I have the following…
Makogan
  • 8,208
  • 7
  • 44
  • 112
38
votes
2 answers

OpenCL, Vulkan, Sycl

I am trying to understand the OpenCL ecosystem and how Vulkan comes into play. I understand that OpenCL is a framework to execute code on GPUs as well as CPUs, using kernels that may be compiled to SPIR. Vulkan can also be used as a compute-API…
cor3ntin
  • 876
  • 1
  • 7
  • 9
34
votes
2 answers

What is the difference between framebuffer and image in Vulkan?

I've known that framebuffer is the final destination of the rendering pipeline and swapchain contains many image. So what is the relation between those two things? Which one is the actual render target? And does the framebuffer later attach the…
EkBumYe
  • 549
  • 1
  • 4
  • 7
33
votes
1 answer

Vulkan: What is the point of sType in vk*CreateInfo structs?

In all of the create info structs (vk*CreateInfo) in the new Vulkan API, there is ALWAYS a .sType member. Why is this there if the value can only be one thing? Also the Vulkan specification is very explicit that you can only use vk*CreateInfo…
Jerfov2
  • 5,264
  • 5
  • 30
  • 52
31
votes
1 answer

What is a "Push-Constant" in vulkan?

I've looked through a bunch of tutorials that talk about push constants, allude to possible benefits, but never have I actually seen, even in Vulkan docs, what the heck a "push constant" actually is... I don't understand what they are supposed to…
Krupip
  • 4,404
  • 2
  • 32
  • 54
29
votes
2 answers

Synchronization between command buffers in Vulkan

There are several ways to handle synchronization in Vulkan. This is how I understand it: Fences are GPU to CPU syncs. Semaphores are GPU to GPU syncs, they are used to sync queue submissions (on the same or different queues). Events are more…
hidayat
  • 9,493
  • 13
  • 51
  • 66
26
votes
4 answers

Should I try to use as many queues as possible?

On my machine I have two queue families, one that supports everything and one that only supports transfer. The queue family that supports everything has a queueCount of 16. Now the spec states Command buffers submitted to different queues may…
Maik Klein
  • 15,548
  • 27
  • 101
  • 197
24
votes
2 answers

What is coherent memory on GPU?

I have stumbled not once into a term "non coherent" and "coherent" memory in the tech papers related to graphics programming.I have been searching for a simple and clear explanation,but found mostly 'hardcore' papers of this type.I would be glad to…
Michael IV
  • 11,016
  • 12
  • 92
  • 223
23
votes
1 answer

Why is a VkFence necessary for every swapchain command buffer when already using semaphores?

I am using exactly 3 images for the swapchain and one VkCommandBuffer (CB) per swapchain image. GPU synchronization is done with two semaphores, one for presentation_finished and one for rendering_finished. The present mode is…
bricklore
  • 4,125
  • 1
  • 34
  • 62
22
votes
3 answers

How'd multi-GPU programming work with Vulkan?

Would using multi-GPUs in Vulkan be something like making many command queues then dividing command buffers between them? There are 2 problems: In OpenGL, we use GLEW to get functions. With more than 1 GPU, each GPU has its own driver. How'd we use…
Egy Prot
  • 345
  • 1
  • 2
  • 6
21
votes
2 answers

What is the meaning of 'attachment' when speaking about the Vulkan API?

In relation to the Vulkan API, what does an 'attachment' mean? I see that word used in relation to render passes (i.e.: color attachments). I have vague idea of what I think they are, but would like to hear the definition from an expert. I'm doing…
Dess
  • 2,064
  • 19
  • 35
20
votes
1 answer

What is the purpose of `binding` from `VkVertexInputBindingDescription`?

https://www.khronos.org/registry/vulkan/specs/1.0/man/html/VkVertexInputBindingDescription.html binding is the binding number that this structure describes. I am not sure what this means for example from…
Maik Klein
  • 15,548
  • 27
  • 101
  • 197
19
votes
1 answer

Should volatile be used when mapping GPU memory?

Both OpenGL and Vulkan allow to obtain a pointer to a part of GPUs memory by using glMapBuffer and vkMapMemory respectively. They both give a void* to the mapped memory. To interpret its contents as some data it has to be cast to an appropriate…
janekb04
  • 4,304
  • 2
  • 20
  • 51
1
2 3
99 100