|
|
|
|
|
by kirillkh
3699 days ago
|
|
When writing my first OpenGL code, I was stunned by the amount of boilerplate required. It is so bad it reminds me of COBOL. No one in their right mind would tolerate that monstrosity in a normal CPU program (except, possibly, some hardcore C++ fans). I think in order to solve this, we need three things:
1) Intermediate representation for compiled GPU code. Bytecode mentioned in the article sounds like it.
2) Cross-platform GPU programming support in our programming languages' standard libraries.
3) Compiler plugins and DSLs that output the IR and link to the library. |
|
Huh, actually the amount of boilerplate required for getting a triangle to the screen with OpenGL is minimal.
- Create a context - fill a buffer with the triangle vertex data - load buffer to OpenGL - create vertex shader implementing vertex to position transformation - create vertex shader implementing pixel coloirization - issue draw commands