3 ms·
Hmm, but I didn't say it was an indirection layer nor an abstraction layer...
by westoncb 8y ago
Hmm, but I didn't say it was an indirection layer nor an abstraction layer...
- MaxBarraclough 8y agoIf I'm understanding you and Zed correctly, you pretty much did, you just didn't use Zed's terminology. As you say, the intent of modern graphics APIs like Vulkan isn't to spare the graphics programmer the hard work of writing low-level code. Instead the intent is to provide a minimal indirection layer which does just enough work to let graphics code work on any vendor's hardware, whilst preserving the graphics programmer's ability to do low-level cleverness. So game-engines and scenegraph systems are in the business of abstraction, but graphics APIs are in the business of indirection.
- westoncb 8y agoOkay, I see your point. But indirection only enters the picture once you introduce the possibility of multiple graphics cards which are being communicated with the same API—and I agree, that is an example of indirection. However, it's not the role I was attempting to highlight. I was considering the role of OpenGL/WebGL in relation to a single graphics card: if you consider that situation, the API is still necessary and what it's doing is neither (much) abstraction nor indirection. Instead, it's main task is essentially conversion: the graphics card needs data in one format, javascript programs assemble their data in another (I'm using data very loosely here; I mean to include even the program source, since it's in a 'format' we can just give directly to a GPU). That said, even something like Vulkan does abstract a bit, and once you bring in the possibility of multiple cards, the value of its role as an indirection layer becomes clear.