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

Vulkan resource ownership transfer vs VK_SHARING_MODE_CONCURRENT & different queue families performance

I have a compute shader which produces vertex buffer and draw indirect structure that are then used to draw some geometry. Compute shader is invoked not every frame, but once per 5-10 frames. In fact, I have my vertex and draw indirect buffers…
YaaZ
  • 380
  • 2
  • 11
5
votes
1 answer

What is the DirectX 12 equivalent of Vulkan's "transient attachment"?

I have a compute shader which I'd like to output to an image/buffer which is meant to be intermediate stoarge between two pipelines: a compute pipeline, and a graphics pipeline. The graphics pipeline is actually a "dummy", in that it does nothing…
bzm3r
  • 3,113
  • 6
  • 34
  • 67
5
votes
1 answer

Transferring memory from GPU to CPU with Vulkan and vkInvalidateMappedMemoryRanges synchronization?

In Vulkan, when I want to transfer some memory the GPU back to the CPU, I think the most efficient way to do this is to write the data into memory which has the flags VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT | VK_MEMORY_PROPERTY_HOST_CACHED_BIT. Question…
j00hi
  • 5,420
  • 3
  • 45
  • 82
5
votes
2 answers

Why some commands can be recorded only outside of a render pass?

I don't know is it an API feature (I'm almost sure it's not) or a GPU specifics, but why, for example, vkCmdWaitEvents can be recorded inside and outside of a render pass, but vkCmdResetEvent can be recorded only outside? The same applies to other…
nikitablack
  • 4,359
  • 2
  • 35
  • 68
5
votes
1 answer

Why is SSAO only working from certain angles/distances?

I am trying to replicate the Sascha Willems SSAO example while using the LearnOpenGL SSAO tutorial as a resource. But my SSAO code is only partially covering models at certain angles/distances, and there is also a very strong self-occlusion effect…
Axiom
  • 103
  • 7
5
votes
1 answer

Does every variable have to be set for every vertex emitted in a geometry shader?

In my geometry shader that I was using in OpenGL setting a variable once at the beginning and then emitting vertices without resetting it works, but in vulkan if I don't write to that variable between every EmitVertex() my code will not work…
Rhu Mage
  • 667
  • 1
  • 8
  • 21
5
votes
1 answer

How to repeatedly update a uniform data for number of objects inside a single Vulkan render pass and make the update synchronized?

I'm trying to port my OpenGL 3D game engine to Vulkan. There are large numbers of 3D objects in the game scene and each has it own attributes (model matrix, lights, etc.) and the objects are completely dynamic, which means some 3D objects may come…
Hongkun Wang
  • 717
  • 8
  • 22
5
votes
2 answers

vulkan extension : which are supported by whom?

There is EXT, KHR or AMD or NV extensions. Maybe there are some others. I know that NV means Nvidia and that it nv extensions are unlikely supported by AMD. But what about khr ones or ext ones? Are they mandatory supported by everyone?
Antoine Morrier
  • 3,930
  • 16
  • 37
5
votes
2 answers

Are atomic float operations in shaders supported with Vulkan?

For OpenGL, the Nvidia extension NV_shader_atomic_float [1] exists which enables atomic read-modify-write operations to buffer or texture memory with floating-point components in GLSL shaders. Does this functionality also exist with Vulkan? I…
j00hi
  • 5,420
  • 3
  • 45
  • 82
5
votes
1 answer

Vulkan - when should I create a new pipeline?

So I want to render two independent meshes in Vulkan. I'm dabbling in textures and the 1st mesh uses 4 of them while the 2nd uses 5. I'm doing indexed draws. Each mesh has its own uniform buffer and sampler array packed into separate descriptor sets…
Carlos Romero
  • 698
  • 8
  • 18
5
votes
1 answer

Vulkan: Difference between instance and device extensions?

Vulkan has instance and device extensions, but I cannot find any information anywhere about what the difference between them is. What does it mean exactly if something is a device extension or an instance extension? Why is VK_KHR_external_memory a…
Silverlan
  • 2,783
  • 3
  • 31
  • 66
5
votes
1 answer

Rendering multiple different materials who will sometimes require different shader configurations

I'm attempting to build a 3D voxel based game engine to learn how to use vulkan. I've run up against a wall that I can't find documentation on how to climb. Right now I am drawing a 2D triangle and moving it around the screen, my 2D triangle is…
Joshua Katz
  • 157
  • 3
  • 12
5
votes
3 answers

How to compile OpenCL Kernels to SPIR-V using Clang

I need compile OpenCL kernels in SPIR-V to use with Vulkan, I tried with Google CLSPV https://github.com/google/clspv, but the problem occur with vectorization, functions like vload8 doesn't work. So I need compile OpenCL kernels in SPIR-V using…
Alex
  • 3,301
  • 4
  • 29
  • 43
5
votes
1 answer

Can a Vulkan sampler's maxLod be too high?

Suppose I'm making a VkSampler, or possibly a set of VkSamplers, that I'm planning on using with several textures. Each texture has multiple mip levels, and the number of mip levels varies from texture to texture. I want all sampler options to be…
mjwach
  • 1,174
  • 2
  • 9
  • 25
5
votes
1 answer

Can graphics and present queues really be different?

almost all examples and tutorials handle the situation when graphics queue index and present queue index are different. But after some testing on multiple gpus I found that they are always the same. The questions are - what are the chances they will…
nikitablack
  • 4,359
  • 2
  • 35
  • 68