From the speed to tell the exchange operation faster.
I first touch the page exchange is when learning DirectX. The appearance of the page swap technology is because the video cache of the SVGA card is already large enough, generally 8M or more, now the mainstream display card can reach 128m. In addition to the display of the visible screen, there is a large amount of remaining, which can be used to store a bitmap that is temporarily displayed on the screen. Under the structure of the VGA / SVGA system, the address assigned by the video cache (66) is 0xA000: 0000-0xA000: FFF 64K and 0xB000: 0000-0XB000: FFF's 64K. The previous one is called a window for graphics mode, and the latter is called a B window for text mode. Another feature of the VGA / SVGA system is to change the starting position of the visible video cache in the video cache by register programming or BIOS calls. This is the hardware foundation implemented by the page switched technology.
The so-called page exchange is to change the starting position of the visible video cache area in the video cache. If a video mode requires a 256K video cache, and the video cache is 8m. In the initialization video mode, the location of the visible video cache area is generally set to the zero offset of the video cache, so that the data of 0-256k in the memory will be displayed on the top of the screen. The 8M memory can have a total of 32 256K, and several can have 32 virtual or invisible screens, and in these areas, if the data is not displayed on the screen.
Since you can change the starting position of the visible video buffer area, we can use excess video cache in the display card as a virtual screen. The bitmap that will hopes in the next frame directly draws directly on the virtual screen. When you want to display, you can directly change the starting location of the visible video cache area to the start address of the virtual screen. That is, the usual page swap (Page Clip). This is true in DirectX. Double buffer is another different way. It does not change the start address of the visible video cache, but opens up a storage area as the screen as the screen in memory or in memory, which is similar to the screen. It is also the same image to which the next frame to be displayed into this buffer screen is different. Different are not changing the displayed video cache start address when displaying, but to copy the data in the buffer screen to the visible video buffer area. Inside. Since the graphical drawing process is performed in an invisible buffer screen, the flashing of the screen can be eliminated. However, because of a large amount of data to copy, the speed may be some. However, the double buffer has its advantages, that is, it guarantees the actual screen and the consistency of the buffer screen data. The page switched technology will not work.
The buffer screen in the double buffer is generally built in memory, not in the video cache. If the hardware provides a read / write operation that has been displayed to the memory, the speed is absolutely faster than the bucket, because the memory to the read and write to the memory should pass the system, and the read and write to the memory (if the hardware support is supported), no need to pass System bus. However, this memory of memory is not written in VESA, not a standard approach, so it is not all graphics cards to provide this memory to memory. If the hardware does not support a read / write operation that is not supported, you can copy the data of a block area in the memory to the memory, then copy another area in the memory, you need two copies, twice through the system bus twice. Therefore, it is conceivable that the cash on the buffer screen is built in the memory is analogous. Since the read and write operations of the memory are not standard operation, the buffer screen is usually not buffered in the memory. In DirectX, DirectDraw will try to get hardware acceleration, and some features do not support it, DirectDraw will use software simulation methods, and I want to say this. Of course, because storage capacity is getting bigger, you can define page switched technology and multi-buffered techniques for multi-page. In the double buffer or multi-buffer, since the consistency of the data can be guaranteed, if a high-efficiency BLT is reached, a more efficient dirty rectangle can be further achieved, thereby achieving only a changed area Drawing, the efficiency will be higher. In terms of the use of memory, it is not difficult to know that the page switched technology is mainly displayed, and cannot use memory to exchange; double buffer technology is usually used, but can also be used, and if hardware supports The read and write of the memory, use the memory buffer screen, speed will be fast, but if the hardware does not support, the speed will be very slow, and it will be very troublesome. If you carefully study the VGA / SVGA system, you should be able to understand the concept of double buffer, page exchange. The internal details of some technologies in DirectX can also be clear. DirectX in DirectX is actually unsticormation, and its internal details can be clear.
Author: Chen Kai RockCarry studio: http: //rockcarry.126.com 2005.2.10 All Rights Reserved