[Notes] D3D12 learning The Swap Chain and Page Flipping

In order to avoid flicker in the animation, the animation frame is preferably the entire outer texture drawing to the screen (off-screen texture) called back buffer. Once the entire scene is drawn to the back buffer given animation frames, frame it as a complete presentation to the screen; in this way, viewers will not watch you draw the frame to - the viewer can only see the full frame. To achieve this, two hardware maintenance texture buffer (texture buffers), called a pre-buffer (front buffer), the other is called the back buffer (back buffer). Until the buffer storing the image data currently being displayed on the monitor, and the next frame of animation is being drawn into the buffer. After the frame is drawn to the back buffer, the role of the back buffer and the front buffer swap: back buffer becomes the front buffer, the front buffer become the next frame of the animation back buffer. The role of the exchange back and front buffer is called the presentation (presenting). Presented is a highly efficient operation, since only the current front buffer pointer exchange and the pointer to the current buffer. Figure 4.1 illustrates this process.

Figure 4.1. For the n frames, the current buffer A is being displayed, the next frame to be rendered to the buffer B, buffer B is used as a current back buffer. After the completion of the drawing frame, switching the pointer, the buffer B becomes the front buffer, back buffer A becomes the new buffer. Then we will render the next frame n + 1 to BufferA. After completion of the frame exchange pointer, the buffer A becomes the front buffer, back buffer buffer B again.

 

Buffer exchange before and after forming chain (a swap chain). In Direct3D, represented by a chain exchange IDXGISwapChain interface. This interface texture before and after storage buffer (the front and back buffer textures) , and to provide an adjusted buffer size (IDXGISwapChain :: ResizeBuffers) and rendering (IDXGISwapChain :: Present) of.
Using two buffers (front buffer and the back buffer) called double buffering. Two or more buffers may be used; the use of three buffers called triple buffering. However, the two buffers is usually sufficient.

  

Ruby: Even after the buffer is a texture (a texture) (referred to as a texel element should therefore), but we often called a pixel element, as in the case of the buffer, which stores the color information (in the case of the back buffer, stores color information do not understand this sentence). Sometimes people will texture elements called pixels, even though it does not store color information (e.g., "normal map pixels").

 

Guess you like

Origin www.cnblogs.com/heben/p/11324829.html