OpenGL is a library. Your C ++ code, which compiles to machine code (for your processor, not the GPU), calls OpenGL functions that send data to your graphics card (GPU). The graphics card interprets this data and uses it to accomplish what you requested. The GPU does not run any of your C ++ code.
GLSL (OpenGL Shading Language) is a language used to indicate what GPU shaders do. Note that the name is a little wrong, because the code written in shading languages ββis now much more than hatching. Typically, you will write your GLSL code the same way you write your C ++ code, and then use OpenGL calls to compile GLSL code, and then use more OpenGL calls to tell the processor to use shader programs.
CPU
C ++ code calls functions OpenGL calls the graphics driver code , which passes instructions to the graphics processor through the hardware.
GPU
Interprets the hardware signals received from the graphics driver to run its own internal programs. This may include compiled GLSL programs, which are also sent from the CPU in the same way.
Note. You can replace "Open GL functions" with "DirectX functions" and "GLSL" with another shader language, and the diagram is the same.
Peter Alexander
source share