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
12
votes
3 answers

How to render to OpenGL from Vulkan?

Is it possible to render to OpenGL from Vulkan? It seems nVidia has something: https://lunarg.com/faqs/mix-opengl-vulkan-rendering/ Can it be done for other GPU's?
abhijit jagdale
  • 609
  • 2
  • 8
  • 21
12
votes
1 answer

Can I create an Immutable Sampler in Vulkan without binding an image to that bind point?

I've been reading over the Vulkan spec and some examples from Khronos but I can't find a lot of information on Immutable Samplers in general. What I'm trying to do is have a descriptor set full of immutable samplers (of type…
Honeybunch
  • 577
  • 5
  • 17
11
votes
0 answers

problem with vulkan floating point behavior

I try to implement the paper Extended-Precision Floating-Point Numbers for GPU Computation by Andrew Thall, Alma College in a GLSL Vulkan compute shader. I need this because some of my devices don't support double precision. My problem is in the…
JLo
  • 111
  • 4
11
votes
0 answers

Is xvfb (with Mesa 19.2) compatible with Vulkan?

I'm trying to run a Vulkan-based graphical application on a headless Ubuntu 19.10 virtual machine, via xvfb. Starting from a bare Ubuntu 19.10 image (created using lxc), I prep the machine as follows: > sudo apt update > sudo apt install -y xvfb…
vpradeep
  • 746
  • 1
  • 6
  • 14
11
votes
2 answers

What can Vulkan do specifically that OpenGL 4.6+ cannot?

I'm looking into whether it's better for me to stay with OpenGL or consider a Vulkan migration for intensive bottlenecked rendering. However I don't want to make the jump without being informed about it. I was looking up what benefits Vulkan offers…
Water
  • 3,245
  • 3
  • 28
  • 58
11
votes
3 answers

Why would vkCreateSwapchainKHR result in an access violation at 0?

I'm trying to learn Vulkan by following the great tutorials from vulkan-tutorial.com but I'm having some trouble at the point where I must create the swap chain. As stated in the title, the vkCreateSwapchainKHR creates the following error: Access…
François Guthmann
  • 461
  • 1
  • 4
  • 15
11
votes
1 answer

Why does vkGetPhysicalDeviceMemoryProperties return multiple identical memory types?

So, I'm gathering some info about my device in Vulkan during initialization and find a unique (or rather, quite similar) set of memory types returned by vkGetPhysicalDeviceMemoryProperties: Device Name: GeForce GTX 1060 3GB Device ID: 7170 Device…
Frzn Flms
  • 468
  • 1
  • 7
  • 18
11
votes
2 answers

Vulkan buffer memory management - When do we need staging buffers?

I read a lot of articles on Vulkan memory management and all of them recommend using staging buffers for transferring to the GPU. But we can already create memory that is device local and host visible, host coherent. It is readable from GPU as well…
user6522494
11
votes
3 answers

Vulkan: Creating and benefit of pipeline derivatives

In Vulkan, you can use vkCreateGraphicsPipeline or vkCreateComputePipeline to create pipeline derivates, with the basePipelineHandle or basePipelineIndex members of VkGraphicsPipelineCreateInfo/VkComputePipelineCreateInfo. The documentation states…
MuertoExcobito
  • 9,741
  • 2
  • 37
  • 78
11
votes
1 answer

Purpose of pNext in Vulkan structures

A lot of the structures used in Vulkan have a sType member, which identifies the type of the structure, and a pNext member, for extension-specific structures. This answer explains quite well what the sType member is for, and why it is needed. It…
Andrew Williamson
  • 8,299
  • 3
  • 34
  • 62
10
votes
2 answers

Do I need dedicated fences/semaphores per swap chain image, per frame or per command pool in Vulkan?

I've read several articles on the CPU-GPU (using fences) and GPU-GPU (using semaphores) synchronization mechanisms, but still got trouble to understand how I should implement a simple render-loop. Please take a look at the simple render() function…
0xbadf00d
  • 17,405
  • 15
  • 67
  • 107
10
votes
3 answers

Why is a single depth buffer sufficient for this vulkan swapchain render loop?

I was following the vulkan tutorial at https://vulkan-tutorial.com/ and at the depth buffering chapter, the author Alexander Overvoorde mentions that "We only need a single depth image, because only one draw operation is running at once." This is…
cluntraru
  • 103
  • 1
  • 8
10
votes
2 answers

Creating multiple command pools per thread in Vulkan

I am trying to set up a multi-threaded renderer with Vulkan and I have a question about command pools. Here https://on-demand.gputechconf.com/siggraph/2016/video/sig1625-tristan-lorach-vulkan-nvidia-essentials.mp4 at 13 minutes, they talk about how…
ulak blade
  • 2,515
  • 5
  • 37
  • 81
10
votes
1 answer

Descriptor Set count ambiguity in Vulkan

I want to draw two objects in vulkan. To achieve this I follow the procedure where you create two different descriptor sets for each model. However, I am confused about the structs that specify the required descriptor set count. The points that…
BulBul
  • 1,159
  • 3
  • 24
  • 37
10
votes
1 answer

Render Qml using Vulkan

I have a Qt application that draws using Open GL. At some point I'm using a QQuickWindow associated to a QQuickRenderControl to draw a QML scene into a texture to later compose it in the final image. Now, I'm considering porting OpenGL to Vulkan and…
gabocalero
  • 473
  • 6
  • 15