APIs are like rules for how programs can talk to devices like GPUs. Device drivers are like translators that help programs communicate with specific devices using those rules. So, when a program wants to use a GPU to draw something, it talks to the device driver, which then tells the GPU what to do based on the rules set by the API.
Think of an API as a middle man, this middle man has to talk to two parties that speak in different languages, the games (as an example of a use-case as gpus have many) and the drivers.
So the middleman talks the language the games understands and talks in the language of drivers understand.
Why wouldn’t games just talk to drivers? It’s been done in the past but the problem is that this layer or middle man is just passed into the game, and it becomes very hard for developers to maintain, because the would need to hard pick and support a myriad of devices, without even considering all the platforms out there.
Latest Answers