Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Native graphic card function

If i understand correcty, the graphics card are programmed to display 2D&3D graphics and these cards have native functions, but because these functions are obsolete and hard to use, we nou use drivers, that makes the programmers life easier.

Now, my question is that if there are some native graphics card function tutorials and if these are universal, that works on every graphics card or differ from one to another like ASM language does. And if there exists tutorials, can i use C language or C++ or i need to have asm knowledge ?

like image 674
Kanghu Avatar asked Dec 21 '22 05:12

Kanghu


2 Answers

The way GPUs are programmed (at least the advanced functions) is typically through either MMIO (as in, an address in virtual memory corresponds to a register in the GPU instead of actual DRAM), or more often, through command buffers (as in, a chunk of memory is used to store commands for the GPU, that the GPU reads sequentially.

Now, those commands and registers are very hardware dependent (even within a single hardware vendor): see for example ATI R600 registers. They are not "universal" at all.

Those types of interfaces are what driver developers use to implement the DirectX and OpenGL APIs that typical programs use.

Probably the best source of "tutorial" for that level of programming are the open source drivers in linux.

like image 81
Bahbar Avatar answered Dec 24 '22 01:12

Bahbar


There's a good reason there are now more standardised ways of talking to the graphics subsystems in computers. Unless you have a specific platform in mind I'd suggest you stick to using the standard API's I.e. go through OpenGL or DirectX.

like image 45
Jon Cage Avatar answered Dec 24 '22 01:12

Jon Cage