Earlier graphics cards were only used for display, and then 2D acceleration components were added to the graphics card, which were used for the operation of the screen, draw points, draw lines, and so on. With the need of game, three-dimensional simulation and scientific computing visualization, the demand for 3D is gradually increasing, the early drawing work is done by the CPU, to achieve realism and real-time effect, can only draw some simple wireframe model, in the 80 's, Stanford University's Jim Professor Clark pioneered the idea of using ASIC technology to achieve a dedicated 3D graphics processor, introducing the world's first universal graphics workstation IRIS1400 in 1984.
AMD the earliest graphics card from R100, until R900 (R600 also use the HD XXXX as the code), R900 (HD 6xxx) is the HD 7XXX series, the latest graphics card using the Rx 2xx code, the latest is the Radeon R9 2xx series. This describes only the programming of the R600 graphics card, so only the graphics cards before and shortly after R600 are discussed.
The evolution of AMD graphics cards is as follows (refer to wiki pages and PPT for Plan9 OS developers):
R100 is a fixed-line graphics card, R200 for the programmable processor, R300 on the basis of R200 has undergone a relatively large change, after R400 and R300 difference is not small. To R500 when the GPU in addition to Vbios, but also introduced Atombios,atombios is a relatively simple script, and platform-independent, interpreter interpretation of Execution (code integration in the kernel driver), however, the 3D core is less than R300 change, Register changes are also less frequent (changes mainly vary in the pixel shader section).
R600 in R500 on the basis of a great change, 2D parts were abolished, 3D parts changed to unified shader architecture, the GPU registers and original completely different, due to the changes in the architecture, the hardware programming has changed greatly. The R700 GPU is an optimized version of R600, where R700 programming and R60 programming are essentially the same, and subsequent evergreen, Southern Island and Northern Island are the continuation of this unified shader architecture. , it is easier to understand the programming of subsequent GPU cores after understanding the programming of R600.
The subsequent sections of this book are described for the R600 core, in general, the important changes in the R600 hardware on R500 basis include (refer to Radeon r6xx/r7xx acceleration):
- No longer contains 2D acceleration parts, all acceleration is done using 3D components
- Using the shader Model 4.0, the unified shader architecture, vertex shader, fragment shader (and geometry shader) are no longer split into separate parts, but are unified and contain geometry Shader
In addition to the above changes, it is also worth noting that the R600 graphics GPU cores are computed based on scalar rather than vector-based (refer to the ATI Radeon HD Programming Guide).
For software programming, there is also a large change in the register read and write mode, in the past when the R500 programming, all the hardware programming can be used in a command package or a normal direct write register, but the R600 part of the register is not able to write the register directly in the manner of programming, Must be done through the 3-type command package (see the code is like this, the R600 Register manual has many register addresses are the same, but the meaning is different, these register offsets are greater than or equal to 0x8000, is correct?? ）。
The following blog will introduce the memory management mechanism, command processing, interrupt mechanism of AMD graphics card, then introduce 3D engine, which includes graphics pipeline and R600 instruction set of graphics card. The follow-up is a reading of the code and some of the information disclosed by AMD to understand the relevant content, there must be many errors, for reference only.
AMD published information can be seen here, AMD published R500 core programming material is the most complete and most detailed, this part of the details of the R500 graphics work principle and some programming details.
Graphics system in "original" Linux environment and AMD R600 graphics Programming (3)--AMD Graphics Introduction