Hot answers tagged

49 votes

Should new graphics programmers be learning Vulkan instead of OpenGL?

If you're getting started now, and you want to do GPU work (as opposed to always using a game engine such as Unity), you should definitely start by learning Vulkan. Maybe you should learn GL later too,...
  • 6,600
41 votes

Should new graphics programmers be learning Vulkan instead of OpenGL?

Learning graphics programming is about more than just learning APIs. It's about learning how graphics works. Vertex transformations, lighting models, shadow techniques, texture mapping, deferred ...
  • 9,211
39 votes
Accepted

Should new graphics programmers be learning Vulkan instead of OpenGL?

Hardly! This seems a lot like asking "Should new programmers learn C++ instead of C," or "Should new artists be learning digital painting instead of physical painting." Especially because it's NOT ...
  • 584
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 ...
  • 9,211
15 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 ...
  • 9,211
13 votes

Why is thread safety such a huge deal for Graphics APIs?

The main gain would be that it would be easier to divide CPU tasks into multiple threads, without having to solve all the difficult issues with accessing the graphics API. Normally you either would ...
  • 451
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 ...
  • 9,211
9 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 ...
  • 9,211
9 votes

Why is thread safety such a huge deal for Graphics APIs?

There's a lot of work needed on the CPU to set up a frame for the GPU, and a good chunk of that work is inside the graphics driver. Prior to DX12 / Vulkan, that graphics driver work was essentially ...
  • 24.3k
9 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 ...
  • 9,211
8 votes

Should new graphics programmers be learning Vulkan instead of OpenGL?

The primary appeal of OpenGL (at least to me) is that it works on many platforms. Currently, Vulkan does not work on OSX, and Apple has a competing API called Metal. It's very possible that it will be ...
8 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. ...
  • 9,211
7 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 ...
  • 9,211
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 ...
  • 6,600
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. ...
  • 511
7 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 ...
  • 511
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. ...
  • 6,600
6 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 ...
  • 161
6 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 ...
  • 175
6 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 ...
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, ...
  • 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 ...
  • 9,211
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 ...
  • 1,343
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 ...
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 ...
  • 511
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 ...
  • 511
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 ...
  • 9,211
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 ...
  • 9,211
4 votes

Why is thread safety such a huge deal for Graphics APIs?

Modern GPUs generally have a single frontend section that processes an entirely linear stream of commands from the CPU. Whether this is a natural hardware design or if it simply evolved out of the ...
4 votes

Should new graphics programmers be learning Vulkan instead of OpenGL?

It depends on what you want to do. If you want to learn graphics programming only for yourself, it really doesn't matter what you choose. If you are thinking about professional work I recommend ...
  • 596

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