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

Vulkan API : max MSAA samples supported is VK_SAMPLE_COUNT_8_BIT

I am writing Vulkan API based renderer. Currently I am trying to add MSAA for color attachment. I was pretty sure I could use VK_SAMPLE_COUNT_16_BIT ,but limits.framebufferColorSampleCounts returns bit flags that allow MSAA level up to…
Michael IV
  • 11,016
  • 12
  • 92
  • 223
6
votes
1 answer

Must a Vulkan pipeline be recreate when changing the size of the window?

As shown at https://vulkan-tutorial.com/code/23_texture_image.cpp: Calling createGraphicsPipeline() to recreate the Pipeline when changing the window size, the dimensions are set in the code below. VkViewport viewport = {}; viewport.x =…
Javin Yang
  • 215
  • 3
  • 11
6
votes
1 answer

Is it possible to wait for a transfer from the staging buffer to complete without calling vkQueueWaitIdle

The following piece of code show you how i transfer a vertex buffer data from the staging buffer to a local memory buffer : bool Vulkan::UpdateVertexBuffer(std::vector& data, VULKAN_BUFFER& vertex_buffer) { …
Kazuya
  • 65
  • 3
6
votes
1 answer

Why Vulkan has a limit of memory allocations?

Is there any technical reasons to limit the maximum number of memory allocations? Check out vkAllocateMemory manual page. It says: The maximum number of valid memory allocations that can exist simultaneously within a VkDevice may be restricted by…
LeshaInc
  • 101
  • 1
  • 2
6
votes
1 answer

OpenGL Vulkan Interoperability

I need some help with OpenGL-Vulkan Memory Exchange. I've already found this topic How to render to OpenGL from Vulkan? But it is not quite what I need. I dont want Vulkan to allocate and export memory. I want to import OpenGL memory to Vulkan,…
DND
  • 63
  • 3
6
votes
1 answer

A rarely mentioned Vulkan function "vkCmdUpdateBuffer()", what is it used for?

This seems to be a simple Vulkan API question but I really can not find answer after search Internet. I noticed there is a Vulkan function: void vkCmdUpdateBuffer( VkCommandBuffer commandBuffer, VkBuffer …
Hongkun Wang
  • 717
  • 8
  • 22
6
votes
1 answer

How to use VkPipelineCache?

If I understand it correctly, I'm supposed to create an empty VkPipelineCache object, pass it into vkCreateGraphicsPipelinesand data will be written into it. I can then reuse it with other pipelines I'm creating or save it to a file and use it on…
Rhu Mage
  • 667
  • 1
  • 8
  • 21
6
votes
1 answer

How to limit the frame rate in Vulkan

I know that the present mode of the swap chain can be used to sync the frame rate to the refresh rate of the screen (with VK_PRESENT_MODE_FIFO_KHR for example). But is there a way of limiting the frame rate to a fraction of the monitor refresh rate?…
Jerem
  • 1,725
  • 14
  • 24
6
votes
1 answer

Vulkan and X11 Pixmap

I'm writing an X11 window manager with a Vulkan based compositor. I'm wondering if there's a way to efficiently load window pixmaps as textures. In OpenGL, one would directly use the EXT_texture_from_pixmap extension to bind the pixmap to a texture.…
jaelpark
  • 91
  • 1
  • 5
6
votes
2 answers

vkAcquireNextImageKHR semantics? What does timing out mean?

I am confused about the semantics of vkAcquireNextImageKHR. Specifically, under what circumstances can the function return VK_TIMEOUT? ie What could block it from not being able to acquire an image immediately? What might it wait for to…
Andrew Tomazos
  • 66,139
  • 40
  • 186
  • 319
6
votes
1 answer

Device to device copy in Vulkan

I want to copy an image/buffer between two GPUs/physical devices in my Vulkan application (one vkInstance, two vkDevices). Is this possible without staging the image on the CPU or is there a feature like CUDA p2p? How would this look? If staging on…
slocook
  • 103
  • 2
  • 8
6
votes
2 answers

Why is VkShaderStageFlagBits a bitmask?

In Vulkan you specify the VkPipelineShaderStageCreateInfo's to the VkGraphicsPipelineCreateInfo structure, and presumably there is supposed to be one VkPipelineShaderStageCreateInfo for each shader stage (for example the vertex, and fragment…
nedb
  • 586
  • 1
  • 4
  • 12
6
votes
1 answer

Should one minimize the number of command pools an application creates?

Say that there is a queue family which supports presentation to a surface, and graphics. Is it better (due to technical reasons) to create a single command pool which handles presentation and graphics, or is it better to create two command pools:…
bzm3r
  • 3,113
  • 6
  • 34
  • 67
6
votes
1 answer

When can I free resources and structures passed to a vulkan vkCreateXXX function?

I'm starting to learn Vulkan, and want to know if VkCreate[...] functions copy the resources pointed in structs into his own buffers. To clarify my question, in this code I load a SPIR shader into my own mkShader struct and then I create the…
Bungow
  • 420
  • 5
  • 11
6
votes
0 answers

How to develop GTK app with Vulkan for Linux?

I'd like to develop an application targeting modern popular Linux distributions that uses GTK for its UI, but also the Vulkan API to render a 3D model. Ideally I'd like to use the gtkmm C++ wrapper for GTK, and the Vulkan C++ API. What ways do I…
Filipp
  • 1,843
  • 12
  • 26