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

Do stencil passes write to color buffer?

I've been examining drawsubpasses sample in LunarG's samples (file: API-Samples/drawsubpasses/drawsubpasses.cpp). In this example, the active sub pass when the very first vkCmdDraw() is called, does not have a color attachment but only a…
hiddenbit
  • 333
  • 1
  • 2
  • 11
5
votes
1 answer

Is Vulkan's VkMemoryHeapFlagBits missing values?

At Vulkan specs 1.0.9 (pg. 180), we have the following: typedef struct VkMemoryHeap { VkDeviceSize size; VkMemoryHeapFlags flags; } VkMemoryHeap; and this description: • size is the total memory size in bytes in the heap. • flags is a bitmask…
Alex Byrth
  • 1,328
  • 18
  • 23
5
votes
1 answer

Vulkan: lazily allocated memory?

I have a situation in which I might require a stencil buffer in a render pass, but, I will not 'know' until mid-way through executing the render pass. Unfortunately, there is no way in Vulkan to modify attachments to the framebuffer, once a render…
MuertoExcobito
  • 9,741
  • 2
  • 37
  • 78
5
votes
2 answers

VK_KHR_WIN32_SURFACE_EXTENSION_NAME undefined, in Vulkan code

I'm attempting to write a simple vulkan based application, but when trying to add the surface extension to the list of enabled extensions, like so: enabledExtensions.push_back( VK_KHR_SURFACE_EXTENSION_NAME ); #if defined (_WIN32) …
Ian Young
  • 1,712
  • 1
  • 16
  • 33
4
votes
1 answer

Is it possible to share textures between processes without texture's data copy?

I tought that it might work using the Vulkan's external memory extension by allocating the memory in process A, create a HANDLE to that memory and pass that HANDLE via shared memory to process B. But this seems is not possible as HANDLE is actually…
CJ_Notned
  • 248
  • 2
  • 11
4
votes
1 answer

In Vulkan (or any other modern graphics API), should fences be waited per queue submission or per frame?

I am trying to set up my renderer in a way that rendering always renders into texture, then I just present any texture I like as long as its format is swapchain compatible. This means that, I need to deal with one graphics queue (I don't have…
Gasim
  • 7,615
  • 14
  • 64
  • 131
4
votes
2 answers

Vulkan hpp header bloating compile times, looking for a workaround

I used clang's ftime-trace to profile the compilation of time of my program. Turns out that about 90% of the time is spent parsing the massive vulkan.hpp header provided by the khronos group. This in turn means that if I minimize the inclusion of…
Makogan
  • 8,208
  • 7
  • 44
  • 112
4
votes
1 answer

Warning haswell support is incomplete

Pretty much the title, when I call (through the hpp header) instance.enumeratePhysical devices() I am getting the warning: MESA-INTEL: warning: Haswell Vulkan support is incomplete Thing is, that's not a validation layer error (my error message…
Makogan
  • 8,208
  • 7
  • 44
  • 112
4
votes
1 answer

What is the best way to clear a `VkImage` to a single color?

I'm learning vulkan, and as a (very) simple project I want to simply clear a single swapchain image to a single color (red). My code works, but I get two validation errors. I would like to know: How can I fix the validation errors in my code Is…
statusfailed
  • 738
  • 4
  • 15
4
votes
2 answers

Vullkan compute shader caches and barriers

I'm trying to understand how the entire L1/L2 flushing works. Suppose I have a compute shader like this one layout(std430, set = 0, binding = 2) buffer Particles{ Particle particles[]; }; layout(std430, set = 0, binding = 4) buffer…
alagris
  • 1,838
  • 16
  • 31
4
votes
1 answer

Vulkan: can work submitted after waiting on a fence read previous submit's writes?

After a thorough read of the Vulkan spec's language on synchronization, I'm trying to confirm that a specific scenario does not introduce a data race. Consider the snippet below, where work in a second queue submit reads the results of work from the…
Daniel S.
  • 312
  • 1
  • 8
4
votes
1 answer

What is vulkan color space?

During creation of vulkan swapchain i've stuck at imageColorSpace and imageFormat parameters in VkSwapchainCreateInfoKHR. I do understand that imageFormat is how actual pixel is encoded and stored in memory and if it color isn't linear then vulkan…
E1Hephaestus
  • 67
  • 1
  • 5
4
votes
1 answer

How to ensure correct destruction of vk::UniqueBuffer and vk::UniqueDeviceMemory

I have run into the following conundrum trying to use Vulkan Hpp unique handles to store a buffer and its allocated memory. I declare the handles vk::UniqueBuffer vertex_buffer; vk::UniqueDeviceMemory vertex_buffer_memory; and populate them using…
user14558378
4
votes
2 answers

ld: too many sections (90295)

I am trying to build a haskell project from Ludum Dare, but whenever I attempt the build I get an error message saying the object file has too many sections. Here is the…
Nailuj29
  • 750
  • 1
  • 10
  • 28
4
votes
1 answer

Deferred render vs forward render + early-z

If it's forward rendering, then the number of times FS executes is the (numberOfAllPixels * numberOfLights), and if it's deferred rendering, then the number of times FS executes is the (numberOfVisiblePixels * numberOfLights). So if I add early-z to…