2

I would like an explanation of what exactly the Vulkan API is. Is it essentially a service that runs on an operating system that talks to a graphics card? Or what exactly is it and how does it work? For example I don't understand why there are graphics card drivers that are written specifically for Vulkan, is Vulkan just a specification or is it an implementation of something or how exactly does it work?

I have read a few articles, including the Wikipedia page but I do not understand how graphics work.

Is Vulkan just a standard that driver implementers follow or is it an actual operating system service that does something?

Rami
  • 490
  • 7
  • 22

1 Answers1

2

So, you have the graphics hardware (graphics cards), and there are lots of different cards that have different internals. If you wanted to write a 3D graphics application (a video game for example) then you'd have to know exactly how to talk to each graphics card that's currently used. Obviously that's a lot of work and even impossible since the internal workings of many video devices are proprietary and not available to the public.

That's where graphics API come in. Graphics APIs provide programmers with an interface to talk to all graphics hardware that support that API. For example, you can write programs using DirectX 11 for all graphics cards that support it. DirectX is an API used for programs that run under MS Windows and XBOX. So is Vulkan another API that is intended to be used for all platforms that support it, like Windows and Linux (and those are pretty much the only OSes that support Vulkan).

What an API does is it translates your commands to something the graphics driver can understand and can further process for the specific graphics card that's installed on your system.

This is basically it in a nutshell. You might want to read more by searching for graphics API-driver-hardware layers.

rashmatash
  • 1,699
  • 13
  • 23
  • So essentially Vulkan is simply a standard that AMD and Nvidia adhere to? Or is it an actual application with code written in C or C++? – Rami Jul 26 '19 at 14:27
  • Yes, they can support Vulkan, DirectX, OpenGL or any other API through their graphics drivers. – rashmatash Jul 26 '19 at 14:29
  • So it's a standard or is it an actual program written in code? – Rami Jul 26 '19 at 14:32
  • 2
    It's a standard/specification *and* it is also code that translates your commands to something graphics driver can understand. It's kinda like a translator. – rashmatash Jul 26 '19 at 14:34
  • Awesome, so Vulkan is what people will build their game engines with and graphics driver creators will take the output of Vulkan and process it in the Gpu, correct? – Rami Jul 26 '19 at 14:36
  • Thanks for answering my questions instead of down voting them. – Rami Jul 26 '19 at 14:39
  • @Rami Vulkan is API specification. Standard by Khronos Group (which is composed of all the relevant vendors). Driver is also colloquially "Vulkan", but technically it is "Vulkan-conformant ICD (Installable Client Driver)", or "Vulkan Implementation" (as refered to often in the spec). Each IHV (Independent Hardware Vendor) would provide their Implementation of the API so it works on their particular GPU\Device. – krOoze Jul 26 '19 at 19:58
  • PS: There's also a Vulkan RT (\Loader), that presents Vulkan as a coherent whole on given OS platform. I.e. most notably it uses all the installed ICDs and presents them as a single whole to the user of Vulkan. That is actual code provided by Khronos itself, and important part of the implementation of the API. ICD would usually install this part so you do not need to worry about it. – krOoze Jul 26 '19 at 20:06
  • @krOoze does that mean in order to build a game engine on top of the "Vulkan" specification the programmer would need to download the "Vulkan" drivers for that particular OS and Gpu before hand? This would also guarantee the game works on any OS where Vulkan is installed, correct? – Rami Jul 26 '19 at 20:07
  • @Rami I would think you are an user of PC. You download the driver package from NV or AMD or Intel site, and it typically installs the whole deal, including WDDM, Vulkan, OpenGL, OpenCL, DirectX, Direct Compute, PhysX, Mantle, HDMI, CUDA driver, or whatever else needed and supported by the particular GPU. To build any app or library you technically need only Vulkan headers, and optionally the Loader\RT `.lib`. To run the Vulkan-based app (either for development or end-user purposes) you need the driver. – krOoze Jul 26 '19 at 20:15