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

Vulkan coordinate system: is +Z inwards?

According to this page: https://matthewwellings.com/blog/the-new-vulkan-coordinate-system/ The Vulkan coordinate system has: The X axis increasing to the right The Y axis increasing downwards The Z axis increasing into the screen In my own my own…
Dess
  • 2,064
  • 19
  • 35
7
votes
2 answers

What is the Vulkan equivalent of the GtkGLArea widget (GTK+)?

Background: I want to write a CAD application. I want to implement all rendering with Vulkan. And I want to use GTK+. I don't want a (visible) different window for the rendered image of the object. So I researched and found the GtkGLArea widget,…
le_me
  • 3,089
  • 3
  • 26
  • 28
7
votes
2 answers

How to connect Android MediaCodec Surface to Vulkan

I have a pretty good understanding of decoding with Android MediaCodec and feeding YUV through a Surface into an OpenGL texture. I would like to do something similar with Vulkan. However I have not been successful in finding any documentation or…
Peter Tran
  • 1,626
  • 1
  • 17
  • 26
7
votes
2 answers

When does it make sense to turn off the rasterization step?

In vulkan there is a struct which is required for pipeline creation, named VkPipelineRasterizationStateCreateInfo. In this struct there is a member named rasterizerDiscardEnable. If this member is set to VK_TRUE then all primitives are discarded…
Brotcrunsher
  • 1,964
  • 10
  • 32
7
votes
2 answers

How to update texture for every frame in vulkan?

As my question title says, I want update texture for every frame. I got an idea : create a VkImage as a texture buffer with bellow configurations : initialLayout = VK_IMAGE_LAYOUT_PREINITIALIZED usage= VK_IMAGE_USAGE_SAMPLED_BIT and it's memory…
libei
  • 93
  • 1
  • 6
7
votes
1 answer

Descriptor bindings and binding numbers

I'm a bit confused by the language used in the spec concerning the descriptor bindings described by the VkDescriptorSetLayoutBinding struct. The binding element is the binding number of this entry and corresponds to a resource of the same binding…
hiddenbit
  • 333
  • 1
  • 2
  • 11
7
votes
2 answers

Using pipeline barriers instead of semaphores

I want to be sure that I understand pipeline barriers correctly. So barriers are able to synchronize two command buffers provided the source stage of the second barrier is later than the destination stage of the first barrier. Is this correct? Of…
user2630015
7
votes
5 answers

How to use glslang

I am trying to use glslang to compile glsl shader code to SPIR-V binaries. The glslang project can be found here: https://github.com/KhronosGroup/glslang It works well via the glslangValidator.exe manually in the command line. But i would like to…
Aedoro
  • 609
  • 1
  • 6
  • 21
7
votes
1 answer

Does Vulkan have a TransformFeedback equivalent

Does Vulkan have support for saving the vertices output from a pipeline stage? I've been looking and I can't find any examples or references, maybe someone else knows otherwise?
Andrew Williamson
  • 8,299
  • 3
  • 34
  • 62
7
votes
1 answer

Surface format is B8G8R8A8_UNORM, but vkCmdClearColorImage takes float?

I use vkGetPhysicalDeviceSurfaceFormatsKHR to get supported image formats for the swapchain, and (on Linux+Nvidia, using SDL) I get VK_FORMAT_B8G8R8A8_UNORM as the first option and I go ahead and create the swapchain with that…
Shahbaz
  • 46,337
  • 19
  • 116
  • 182
6
votes
0 answers

"portable" way to determine GPU core occupancy with Vulkan

For writing GPU computation kernels (aka "compute shaders" in GL/Vulkan), it is useful to query various shader parameters such as register usage and shared memory usage that determine how much individual threads may get scheduled to a single…
exa
  • 859
  • 7
  • 27
6
votes
2 answers

How should Staging Buffer be used performance-wise properly?

How should the Vulkan API's staging buffer be used properly? Because saving your vertex data into the staging buffer, than copied to the vertex buffer in the GPU, seems to be taking a longer step than just directly submitting your vertices to your…
entropy32
  • 169
  • 3
  • 11
6
votes
2 answers

Is there anyway to set the VkDescriptorImageInfo to null or have some way of skipping using a VkWriteDescriptorSet without vulkan complaining

Some of the mesh that I'll be using doesn't always have a DiffuseMap or a SpecularMap. When I try to load something without a diffuse and specular map the program crashes because there's nothing in the DiffuseMap.ImageView/SpecularMap.ImageView…
klj
  • 101
  • 5
6
votes
2 answers

In Vulkan, is it beneficial for the graphics queue family to be separate from the present queue family?

As far as I can tell it is possible for a queue family to support presenting to the screen but not support graphics. Say I have a queue family that supports both graphics and presenting, and another queue family that only supports presenting. Should…
小奥利奥
  • 231
  • 2
  • 9
6
votes
1 answer

What use has the layout specifier scalar in EXT_scalar_block_layout?

Question What use has the scalar layout specifier when accessing a storage buffer in GL_EXT_scalar_block_layout? (see below for example) What would be use case for scalar? Background I recently programmed a simple Raytracer using Vulkan and…
Lukas-T
  • 11,133
  • 3
  • 20
  • 30