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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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.
...
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 ...
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 ...
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. ...
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 ...
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 ...
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 ...
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
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, ...
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 ...
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
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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....
...
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 ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
vulkan × 130opengl × 32
glsl × 20
c++ × 14
raytracing × 12
shader × 12
directx12 × 11
compute-shader × 9
gpu × 8
rendering × 6
directx × 6
synchronization × 5
metal × 4
multithreading × 4
3d × 3
texture × 3
algorithm × 3
performance × 3
buffers × 3
api × 3
driver × 3
pathtracing × 2
projections × 2
real-time × 2
fragment-shader × 2