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

How to fix VK_KHR_portability_subset error on mac m1 while following vulkan tutorial

Hi i'm having an error on compile. Apparently i'm missing an extension : validation layer: Validation Error: [ VUID-VkDeviceCreateInfo-pProperties-04451 ] Object 0: handle = 0x1055040c0, type = VK_OBJECT_TYPE_PHYSICAL_DEVICE; | MessageID =…
Thomas Ung
  • 154
  • 13
5
votes
1 answer

Vulkan VK_ERROR_LAYER_NOT_PRESENT

I'm currently learning vulkan with golang, and I've run into an issue creating the vulkan instance with validation layers. I'm trying to use VK_LAYER_KHRONOS_validation, and it shows up as an available layer when I call…
Jen Reiss
  • 51
  • 1
  • 2
5
votes
1 answer

Vulkan Array of Specialization Constants

Is is possible to have an array of specialization constants such that the glsl code looks similar to the following: layout(constant_id = 0) const vec2 arr[2] = vec2[] ( vec2(2.0f, 2.0f), vec2(4.0f, 4.0f) ); or,…
Ryoku
  • 397
  • 2
  • 16
5
votes
1 answer

Synchronizing two render passes: color attachment to sampled?

In Vulkan, suppose I have two render passes: the first outputs to an image as its color attachment. the second samples from that same image from its fragment shaders (ie through a combined image sampler). The render passes are submitted in that…
Andrew Tomazos
  • 66,139
  • 40
  • 186
  • 319
5
votes
2 answers

Android Studio - Error in launch emulator - Vulkan-1.dll

when I launch the emulator in Android Studio, the following two errors occur in the event log: Emulator: handleCpuAcceleration: feature check for hvf Emulator: cannot add library vulkan-1.dll: failed Someone knows how to solve them? Thank…
marco94
  • 157
  • 1
  • 7
5
votes
1 answer

How to suballocate buffers in Vulkan

A recommended approach for memory management in Vulkan is sub-allocation of buffers, for instance see the image below. I'm trying to implement "the good" approach. I have a system in place that can tell me where within a Memory Allocation is…
mike
  • 1,192
  • 9
  • 32
5
votes
1 answer

What is a resolve attachment?

Vulkan spec says: Resolve Attachment A subpass attachment point, or image view, that is the target of a multisample resolve operation from the corresponding color attachment at the end of the subpass. Can I get a more noob-friendly description of…
Dess
  • 2,064
  • 19
  • 35
5
votes
0 answers

wgpu-native performance vs Vulkan

I've been reading about wgpu-rs and that it uses Vulkan, Dx12, Metal etc if used to build native desktop applications. Given this could one expect comparable performance between wgpu-rs and using vulkan directly? I'm an amateur in the graphics…
5
votes
1 answer

Is there a way update a texture with out using a staging buffer?

I'm working with the https://vulkan-tutorial.com/ Depth Buffering code as a base. Made a few changes to update the command buffer every frame. I'm using a crude way of checking fps. Not sure how accurate it really is, but I'm using this check to the…
dhz
  • 101
  • 1
  • 6
5
votes
1 answer

Vulkan render to texture

In an existing renderer which draws geometry in the swapchain, I need to render some parts of this geometry in a texture, others parts must remain on screen. All the geometry is recorded into one command buffer. I won't need to render this texture…
Leon
  • 554
  • 4
  • 18
5
votes
1 answer

Setting up a Vulkan project with CMake on Windows

Until this point I have installed MinGW, CMake, and the Vulkan SDK. I also downloaded the GLFW precompiled binaries, GLM and PkgConfig according to this answer. Then I created a CMake project in CLion. This is the content of the CMakeLists.txt…
lizardsudoku
  • 51
  • 1
  • 2
5
votes
2 answers

Is it OK to read from an input attachment and write to the same attachment in the same drawcall?

I was wondering if an attachment is used as both input attachment and color/ds attachment, a drawcall read from the input attachment then write to the same color/ds attachment, is it allowed? If the next drawcall is also doing the same thing, from…
painkiller
  • 155
  • 1
  • 5
5
votes
1 answer

Automatically compile OpenGL Shaders for Vulkan

Is there any way to automatically compile OpenGL shaders for Vulkan? The problem is with the uniforms. 'non-opaque uniforms outside a block' : not allowed when using GLSL for Vulkan I have tried compiling for OpenGL, then decompiling with…
me'
  • 494
  • 3
  • 14
5
votes
1 answer

Normalizing UV Coordinates From OpenGL To Vulkan

I'm writing a Vulkan Renderer for GWEN (GUI Without Extravagant Nonsense) and having issues getting texture coordinates to match up. Here's what I should see: And this is what is currently happening: The texture displayed in the center is the…
KKlouzal
  • 732
  • 9
  • 32
5
votes
1 answer

Vulkan WaW hazard & memory barrier

Vulkan spec states: Write-after-read hazards can be solved with just an execution dependency, but read-after-write and write-after-write hazards need appropriate memory dependencies to be included between them. I thought that WaW can be solved…
YaaZ
  • 380
  • 2
  • 11