The question arose whether it would be possible to implement the basic set of OpenGL functions.
I will consider Nvidia graphics cards.
As far as I know, all implemented functions according to the OpenGL specification are on the graphics card, it remains only to find the address of the function and interact with it.
Is it possible to draw some primitive object on the screen using OpenGL, protected mode and graphic mode?
Is it possible to implement the basics of OpenGL in kernel?
Re: Is it possible to implement the basics of OpenGL in kern
Literally anything could be in kernel. MS used to render the mouse cursor in kernel.
Re: Is it possible to implement the basics of OpenGL in kern
How to do it?GMorgan wrote:Literally anything could be in kernel. MS used to render the mouse cursor in kernel.
Re: Is it possible to implement the basics of OpenGL in kern
OpenGL is not implemented in the graphics card, it is implemented in the graphics card driver. It requires extensive support, including but not limited to: a VRAM memory manager, a compiler of the shader language to the GPU's native instruction set and a command submission engine. Look into Mesa to see how a shader compiler and command buffers work on modern GPUs.
managarm: Microkernel-based OS capable of running a Wayland desktop (Discord: https://discord.gg/7WB6Ur3). My OS-dev projects: [mlibc: Portable C library for managarm, qword, Linux, Sigma, ...] [LAI: AML interpreter] [xbstrap: Build system for OS distributions].
Re: Is it possible to implement the basics of OpenGL in kern
Do you think it is possible to transfer a part of Mesa to your kernel and use it?Korona wrote:OpenGL is not implemented in the graphics card, it is implemented in the graphics card driver. It requires extensive support, including but not limited to: a VRAM memory manager, a compiler of the shader language to the GPU's native instruction set and a command submission engine. Look into Mesa to see how a shader compiler and command buffers work on modern GPUs.
Re: Is it possible to implement the basics of OpenGL in kern
I'll just quote GMorgan here.GMorgan wrote:Literally anything could be in kernel. MS used to render the mouse cursor in kernel.
You can implement anything in kernel space. It wouldn't be terribly different from implementing in user-space.
You'd need, amongst others, dynamic memory allocation and a working C library.
Then start porting all supporting libraries to your OS, then port libmesa to your OS.