Skip to main content
24 votes

What are Metal and Vulkan?

Metal and Vulkan are low-level 3D graphics APIs, in much the same way that OpenGL and Direct3D are 3D graphics APIs. Metal is Apple's API, usable on iOS and MacOS. Vulkan was developed by the Khronos ...
Nicol Bolas's user avatar
  • 9,997
16 votes

What's the main difference of pipeline process between Vulkan and DX12?

D3D12 has 4 separate kinds of command lists: direct, bundle, compute, and copy. Vulkan has similar concepts, but they happen in a different way. Command buffers are allocated from command pools. And ...
Nicol Bolas's user avatar
  • 9,997
12 votes
Accepted

Why can't I utilize multiple CPU cores with OpenGL like Vulkan?

Because the fundamental foundation of OpenGL makes multi-CPU-core submission impossible. OpenGL, at its core, is a synchronous API. Every OpenGL command behaves "as if" it were executed and completed ...
Nicol Bolas's user avatar
  • 9,997
12 votes
Accepted

What are the use cases for multiple render passes?

Instead of listing specific use cases, I will explain the technical limitations of a render pass structure which would prevent someone from putting all of their rendering within it. The use cases ...
Nicol Bolas's user avatar
  • 9,997
11 votes
Accepted

Vulkan: Uniform Buffers versus Push Constants for static data

UBOs can be updated at any time with vkCmdUpdateBuffer From the specification: "vkCmdUpdateBuffer is only allowed outside of a render pass." So "at any time" is not the case. Even if it were ...
Nicol Bolas's user avatar
  • 9,997
9 votes
Accepted

Vulkan: how does host coherence work?

How does the driver know what to update/transfer and when? It doesn't. There is no transfer or update in that fashion. All memory allocated through a Vulkan device represents memory that some device ...
Nicol Bolas's user avatar
  • 9,997
9 votes
Accepted

Is vkCmdPushDescriptorSetKHR efficient?

What you're ultimately trying to do is, between draw calls, change some state that allows one to select which set of read-only data to use in the rendering process. There are many techniques for this. ...
Nicol Bolas's user avatar
  • 9,997
8 votes
Accepted

How do I create a Win32 window with a Vulkan context?

There's no such thing as a Vulkan context, the way there is with OpenGL. This is because Vulkan is a lower level API and an OpenGL context ties together a number of concepts that are distinct in the ...
Jherico's user avatar
  • 556
7 votes

FPS counter for a simple Vulkan app

You might want to try the VK_LAYER_LUNARG_monitor layer from the LunarG Vulkan SDK. Download the SDK from the LunarXchange site. After SDK installation, you can activate the layer by setting this ...
Karl Schultz's user avatar
7 votes
Accepted

Can i compile my shaders to SPIR-V without using glslangValidator?

Typically compiling GLSL to SPIRV would be something you do as part of the build process, so that you end up distributing SPIRV instead of GLSL. Then you don't need to compile it at runtime. ...
Jherico's user avatar
  • 556
7 votes
Accepted

What prevents older GPUs from supporting Vulkan?

So, I'll start by saying I'm not a driver developer, but I have read many comments and docs in this regard. First of all, we can see how Khronos's own slides on presentation day were mentioning some ...
mirh's user avatar
  • 185
7 votes
Accepted

What mechanisms are being used by Directx12 and Vulkan APIs in order to communicate with graphic card drivers internally?

It's very different between the Khronos standards (including Vulkan) and DirectX. In DirectX, Microsoft implements the API, but they publish to GPU vendors a HAL API. There's actually two HALs: one ...
Dan Hulme's user avatar
  • 6,880
7 votes

Should new graphics programmers be learning Vulkan instead of OpenGL?

I would like to give you my graphics beginner perspective on the subject. What I realised (in many years working as an engineer in another field) is that the fundamental concepts are the most ...
ingframin's user avatar
  • 171
6 votes
Accepted

Colorblending shader recompilation scenarios

In GL's model of the GPU, the colour blending step is performed by special-purpose hardware. This idea dates back to the fixed-function origins of GL, before programmable shaders were even a thing. ...
Dan Hulme's user avatar
  • 6,880
6 votes
Accepted

Is a single shader and 1x1 pixel white sampler more efficient than frequent switching between shaders with and without samplers?

This is a really hardware-dependent question. But in general the best way to think about this is bottlenecks. You mentioned: one set of shaders, one slightly larger vertex struct and just uniform, ...
Calvin's user avatar
  • 506
6 votes
Accepted

Clarifying vulkan glsl std140

The block should total up to 8320 bytes. No, it shouldn't. You use a uint[16] array. Well, std140 layout makes it clear that the array stride for any array is ...
Nicol Bolas's user avatar
  • 9,997
5 votes
Accepted

Best way to clear a framebuffer image without drawing?

You are looking for vkCmdClearColorImage, It does exactly what it says on the tin, it clears an image to a specified color. This command uses the Transfer stage ...
ratchet freak's user avatar
5 votes

Vulkan best way of updating pipeline viewport

Both suggested methods are fine, but they should be preferred in certain situations. Dynamic state should be preferred in situations where you have many, perhaps thousands of, pipeline objects or you ...
aces's user avatar
  • 1,383
5 votes
Accepted

How much does driver quality affect Vulkan and DX12 compared to OpenGL and DX11?

TL;DR: There's some room for optimization in Vulkan drivers, but not nearly to the degree that there is in GL / DX11 drivers. how much do drivers affect performance? It depends a great deal on ...
Jherico's user avatar
  • 556
5 votes
Accepted

Vulkan: efficient way to update VBO mesh vertices?

With OpenGL I would have to reload whole vertex VBO's. No you wouldn't. You can use glBufferSubData I suppose with Vulkan there could be a way to directly ...
Jherico's user avatar
  • 556
4 votes
Accepted

Instanced Stereo Rendering vs. Multiple Command Buffers

Yes, there are advantages. You can render different command buffers to different queues. Modern NVIDIA hardware, in particular, offers a full sixteen separate queues that are capable of rendering ...
Nicol Bolas's user avatar
  • 9,997
4 votes
Accepted

Is it possible to emulate Vulkan on a non Vulkan compatible gpu?

It's possible to emulate Vulkan on a sufficiently capable non-Vulkan API. This is the point of the Vulkan Portability Initiative. Indeed, there is already a Vulkan implementation on top of the Apple ...
Jherico's user avatar
  • 556
4 votes

How different is the SPIR-V accepted by OpenGL (ARB_gl_spirv) from SPIR-V accepted by Vulkan?

Vulkan and OpenGL use different models for their resource bindings. Vulkan uses descriptor sets + binding, while OpenGL uses binding indices. As such, the SPIR-V they consume use different decorations ...
Nicol Bolas's user avatar
  • 9,997
4 votes
Accepted

shaderc compile through api with #include

It is your responsibility to support includes by instantiating an IncluderInterface instance and calling SetIncluder(...) on the ...
Jherico's user avatar
  • 556
4 votes
Accepted

Multiple swapchains in Vulkan app with ImGui

The Vulkan specification is very clear on this: A native window cannot be associated with more than one non-retired swapchain at a time. You can create a new swapchain for a surface, but only by ...
Nicol Bolas's user avatar
  • 9,997
4 votes

How was computer graphics libraries or gtk,qt programmed?

You're asking about two different types of library. OpenGL and Vulkan aren't just libraries: they're hardware interfaces. They are implemented by GPU vendors so that application developers can access ...
Dan Hulme's user avatar
  • 6,880
4 votes
Accepted

When do people need to work directly with a graphical API (eg: Direct3D) instead of using already made software?

This is a similar question to following: When do you need to cook? You can go to a restaurant. Why would you need to know woodworking? You can buy things from a shop. There are two answers here In ...
joojaa's user avatar
  • 8,457
4 votes

Does Vulkan have the equivalent of OpenGL's separable shader program and pipeline?

On current GPU architectures, at the machine level, compilation of a shader program can depend on which other pipeline stages are active, what the inputs/outputs to those shaders are, as well as what ...
Nathan Reed's user avatar
  • 25.3k
4 votes
Accepted

vulkan perspective matrix vs opengl perspective matrix

Note that there is a little extra info here to (hopefully) provide the info need to understand the answer at the end. Plus I don't know of any sources that gives all the solutions in one place.... ...
pmw1234's user avatar
  • 3,484
4 votes

vulkan perspective matrix vs opengl perspective matrix

(I don't have enough rep yet to add a comment) @pmw1234's explanation and solution work well. However, instead of writing out the perspective matrix by hand to handle the [0,1] Z-range of vulkan clip ...
deadbird11's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible