4

I'm very new to graphics programming and trying to understand "how graphics programming works". From what I read so far, I'm still not clear about where the APIs like OpenGL and Direct3D stand and who actually implements them?

Drivers talk to hardware directly.So NVIDIA/AMD etc write drivers and someone else need to implement these APIs on top of that? But I saw "OpenGL driver" on Nvidia website, that means OpenGL is actually a driver level API which directly talks to graphics hardware? So Nvidia/AMD implements these APIs?

I can understand the game engines etc written on top of OpenGL/Direct3D but couldn't figure out where exactly these APIs stand from a programmers perspective.

Sreekar
  • 995
  • 1
  • 10
  • 22

1 Answers1

6

Direct3D itself is wholly implemented by Microsoft. However, it specifies an even lower-level API (The DXGI DDI resp. Direct3D DDI) that is then implemented by Nvidia/AMD as part of the device drivers. So basically D3D is a shim between application code and driver code. Recent advances in graphics architecture have caused the intermediate layer provided by D3D to become thinner and thinner as to reduce CPU overhead.

OpenGL under Windows is implemented similarly: Microsoft provides the application-facing implementation of the OpenGL API, but forwards it to a device-driver implementation, the OpenGL Installable Client Driver.

The quality of OpenGL implementations under Windows is known to vary between vendors. For this reason, both Firefox and Chrome execute WebGL via ANGLE, which translates OpenGL API calls to Direct3D API calls, thus taking the more stable codepath.

Alexander Gessler
  • 45,603
  • 7
  • 82
  • 122
  • That was really informative but What about openGL? In last sentence you were saying DXGI DDI is becoming thinner right? – Sreekar Sep 02 '14 at 20:03
  • @Sreekar: I think he meant the Microsoft specific part, Direct3D, the one between the driver and applications. The trend is to make apps the abstraction between apps and hardware as thin as possible, see also AMD Mantle or Apple Metal. – Antoine Sep 02 '14 at 20:51
  • Amended. Someone else will have to fill in the Linux details. – Alexander Gessler Sep 02 '14 at 20:59
  • @Antoine and Alexander Thank you...Now I'm very clear about these things :) – Sreekar Sep 03 '14 at 19:07