How is OpenGl implemented in the operating system?

I am learning linux and the Graphical API, however I am confused about how opengl is implemented on operating systems. Is this just a collection of libraries that use the kernel to “talk” with your graphics card about which pixels are colored or not? if so, then I don’t know where the pipeline goes - like 3D raster scenes and the geometry of the shader effect.

And how does the GPU support shader languages ​​from both DX and OGL? - and where do the shader languages ​​really fit? - are they compiled or interpreted at runtime?

I do not have much experience with the graphics API, despite using multiple game engines - usually nitty gritty is much lost with several levels of abstraction.

+6
source share
3 answers
+1
source

I can’t talk about how the API is implemented.

But I know from experience that shaders are compiled. Therefore, you compile them and send them to your GPU, where they are executed.

0
source

At least on most typical graphics cards, most of the OpenGL pipeline (fixed or programmable) is implemented in the graphics hardware itself. This is more related to DirectX (i.e. DirectX lacks a bit of functionality in OpenGL that is not directly supported by current hardware).

Shaders are usually compiled. The graphics card has a special processor (or, often, more than one), so the compiler takes input in the shader language and turns it into assembly language for this processor, as does the C compiler for the CPU. Support for different input languages ​​is not much different from a single processor that supports input in C, C ++, Pascal, Fortran, Cobol, etc.

0
source

Source: https://habr.com/ru/post/918260/


All Articles