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: Renderpass LoadOp and StoreOp synchronisation

Context In the specification it talks about which pipeline stage the loadOp and storeOp of an attachment occur in (Here - The 2nd and 3rd paragraph after the bulletpoints), and which access types they use (Here): Load operations for attachments…
AlastairHolmes
  • 427
  • 2
  • 10
5
votes
0 answers

What does it mean that DX12 has heterogeneous multi GPU support and Vulkan doesn't?

I've been looking into using vulkan to leverage compute capabilities on integrated graphics and discrete graphics capabilities. However, according to this article, despite having multi gpu support through compatible SLI configurations, Vulkan does…
Krupip
  • 4,404
  • 2
  • 32
  • 54
5
votes
1 answer

How to get 16bit floats in modern GLSL with Vulkan?

It appears at one point in time Nvidia had an extension that permitted half floating point values for OpenGL 1.1, but apparently since that time *the world half has been reclaimed by the modern GLSL spec at some point. Today I can use 16bit…
Krupip
  • 4,404
  • 2
  • 32
  • 54
5
votes
2 answers

Vulkan Queue Synchronization in Multithreading

In my application it is imperative that "state" and "graphics" are processed in separate threads. So for example, the "state" thread is only concerned with updating object positions, and the "graphics" thread is only concerned with graphically…
Cinolt Yuklair
  • 397
  • 2
  • 11
5
votes
1 answer

Vulkan Texture fuzzy issue

I have a simple Vulkan setup that loads a quite large mesh file (woman) and also applies the diffuse and normal map textures. Vertex Shader: #version 450 core layout (set = 0, binding = 0) uniform ModelMatrix { mat4 model; }…
chakmeshma
  • 246
  • 8
  • 27
5
votes
1 answer

Pipeline barriers across multiple shaders?

Judging by Vulkan barriers explained, it seems like each vkCmdPipelineBarrier introduces a dependency between two subsequent pipeline “runs”. For a typical scenario of a shader A that writes an image and a shader B that samples the same image, it…
haasn
  • 53
  • 3
5
votes
2 answers

Why do input attachments need a descriptor set to be bound?

VkRenderPassCreateInfo contains the attachment indices used for Depth, Color and Input attachments. The corresponding image views are referenced in VkFramebufferCreateInfo::pAttachments. In the shader input_attachment_index identifies which input…
MaVo159
  • 135
  • 2
  • 12
5
votes
1 answer

Cannot use vkCreateWin32SurfaceKHR to create vulkan surface

I want to use vulkan with SDL2 but I am stuck at the surface creation stage, i cannot use vkCreateWin32SurfaceKHR extension function as well as VkWin32SurfaceCreateInfoKHR extension struct as they are undefined, while i don't have any issues using…
BulBul
  • 1,159
  • 3
  • 24
  • 37
5
votes
3 answers

How to create and run an example Vulkan app on the Android emulator?

I want to play around with mobile Vulkan without having to buy a device. If it is not supported, please provide evidence (e.g. source code, official Google statements). Are there any plans to support it? If supported, please give detailed and tested…
Ciro Santilli OurBigBook.com
  • 347,512
  • 102
  • 1,199
  • 985
5
votes
3 answers

How can one not make assumptions about C++ struct layouts?

I've just learned from Bug in VC++ 14.0 (2015) compiler? that one shouldn't make assumptions about how a struct's layout will end up in memory. However, I don't understand how it is common practice in a lot of code I've seen. For example, the Vulkan…
5
votes
1 answer

Is there a way to use clz() in a Vulkan compute shader?

I'm interested in implementing a particular algorithm in a set of Vulkan compute shaders. The algorithm uses a clz() function at one point. I expect that my NVIDIA GPU probably offers hardware support for this function; CUDA uses a clz instruction…
mjwach
  • 1,174
  • 2
  • 9
  • 25
5
votes
2 answers

Vulkan and transparent windows

I'm currently adapting my personal engine to Vulkan and I want to reimplement transparent windows, which I already had with OpenGL. I thought that all I need to do is to select the correct color format ( with alpha channel ) and to set the…
Felix K.
  • 6,201
  • 2
  • 38
  • 71
5
votes
1 answer

texture2D not compatible with Compute Shaders on android mobile phone?

I am trying to use texture2D() to read a value from a sampler2d texture in a compute shader. On PC it is working fine, but on a android mobile device (using version 310 es) the compilation for the same code fails with the folowing error: 'texture2D'…
markwalberg
  • 311
  • 2
  • 10
5
votes
2 answers

Why doesn't the Vulkan spec define VkDeviceSize?

The Vulkan specification (1.0.12) introduces VkDeviceSize in section 2.4: With few exceptions, Vulkan uses the standard C types for parameters (int types from stdint.h, etc). Exceptions to this are using VkResult for return values, using VkBool32…
Andrew Williamson
  • 8,299
  • 3
  • 34
  • 62
5
votes
3 answers

Vulkan's VkAllocationCallbacks implemented with malloc/free()

I'm reading Vulkan Memory Allocation - Memory Host and seems that VkAllocationCallbacks can be implemented using naive malloc/realloc/free functions. typedef struct VkAllocationCallbacks { void* pUserData; …
Alex Byrth
  • 1,328
  • 18
  • 23