r/GraphicsProgramming • u/TheNextJohnCarmack • Dec 20 '21
Question x64 instructions for GPU stuff?
I am thinking about creating an OS, just for myself, but I wanna do 3D games on it. Can I just write my own driver for one specific GPU (nevermind the logistics, this is a hobby project. I just want to know if it is POSSIBLE), and how would I do that?
3
Upvotes
13
u/Mason-B Dec 20 '21
Is it possible? Yes, in theory... with infinite time and resources. Is it likely or easy? Absolutely not. Even now the two major GPU suppliers (NVidia and AMD) require loading of proprietary microcode to perform 3d acceleration and function correctly. There are people who try to reverse engineer this stuff from scratch, and I think they've made some progress. But the reality is that it's very very hard to reverse engineer a chipset and assembly from scratch. I say this as someone who shoots the shit with multiple people who reverse engineer stuff for a day job. Even they have a starting point, a manual or documented prior art. For most parts of what you would want to do, that would not exist.
And to be clear, the GPU is a separate chipset, with it's own instruction set, hence "x64 instructions for GPU stuff" is a nonsensical statement, as x64 describes the CPU chipset.