KKNDT wrote:Take chief's diagram as an example, frame 3 starts rendering as soon as frame 2 is ready, at this moment, frame 1 is still being scanned out. So, it looks like a framebuffer can hold more than 1 frame, otherwise VSYNC ON will get activated and make a pause between frame 2 and frame 3. That's what I want to confirm.
Whoa,
It's important to fix your terminology, use the phrases correctly, in the correct language:
An arm is not a leg.

A face is not a foot.

A frame buffer is 1 frame.
GLOSSARY
Frame buffer = one frame
Frame queue = multiple frame buffers. Like a book of frame buffers.
Swap chain = Another common term for a "frame queue". Like a book of frame buffers.
Flipping the framebuffer = Flip to the next frame buffer in the frame queue / swap chain.
Swapping the framebuffer = Same as "buffer flip"
Prerendered frames = One fully completed undisplayed frame waiting in the frame queue / swap chain
Buffering up = The continual adding of more frame buffers to the swap chain.
Double buffering = Two frame buffers
Triple buffering = Three frame buffers (modern definition), although the classical 3Dfx definition of triple buffering (from the late 90s/early 00s) was the low-lag NVIDIA Fast Sync technique.
The Book Metaphor of a Swap Chain
(Coined by Blur Busters)
The Plain English Book Metaphor of a "swap chain" or "frame queue":
- Frames (framebuffers) are simply pages in a book.
- New frames get inserted at the end of the book.
- The GPU is simultaneously the book writer and the book reader.
- The reader is the GPU reading the book out to the display, displaying page after page after page, one line (pixel row) at a time.
- The writing is the GPU creating new frames to insert to the end of the book.
- There can be several pages between the reader (screen) and the end of the book (GPU rendering adding new pages to the book).
- Once a refresh cycle is completed, the previously displayed page (the page before the now-onscreen page) of the book can be safely deleted from computer's memory. So memory only needs to holds only 2 or 3 or 4 pages of a book. (The monitor may hold its own separate copy of the last few pages of the book, e.g. for overdrive processing and other stuff -- basically a display's separate frame queue for its own internal display processing -- but that's optional, it may be synchronous scanout, line-for-line.) It's like an endless infinite book where the beginning of the book is continually deleted, and the end of the book is continually being extended.
- Duplicate refresh cycles is simply re-reading the same page of the book again, while waiting for the GPU to add a new page to the book.
- The GPU "reads out" the page to the monitor (Scan out)
- The reading (scan out) is top-to-bottom, like a common book, one pixel row at a time, left to right, raster-scan fashion.
- Tearing of VSYNC OFF is simply using scissors horizontally on the unread portion of the page, and splicing the bottom part of the new page to the current page that the GPU is reading out to the monitor.
- The more pages of book between the currently-displayed page, and the end of the book, the more input lag. (e.g. 2 frames of lag = you're 2 pages behind).
Metaphorically, the first page is the GPU rendering machine, and the last page is the actual screen display-out. There can be a line-up of waiting buffers in between. Tweaks like "Max Prerendered Frames" in NVInspector will affect how big your book can become -- it can be a big book, especially if the GPU is faster than the display (VSYNC ON).
The swap chain / frame queue is usually 2 or 3 buffers. Basically a book of 3 pages -- since pages are being deleted as fast as being added. But it's actually an infinite book where pages are being added as quickly as being deleted. Pages (new GPU rendered frames) are being added in realtime, and the reader is the GPU scanning out to the display -- and once moved onto the next page, the previous page is deleted (no need to keep it in memory).
The Book Metaphor on Common Graphics Operations
NVIDIA Fast Sync - The newest buffer will overwrite the next page (the page after the currently-being-read page) if there is one.
Essentially ripping that last page out, and replacing that last page. That way, there's only 1 page after the currently-being-read page. This reduces lag, without a tearline.
AMD Enhanced Sync - Same as NVIDIA Fast Sync
VSYNC OFF - Metaphorical scissors on the still-yet-unread portion of the page (on the top-to-bottom scanout) and replace with the bottom portion of your brand new page. This can be repeated multiple times (for multiple tearlines on the same page) -- e.g. stitching multiple fresher frames on the same frame (multiple brand new pages continually stitched on the fly, in the "sentences below what the reader is currently reading") --
imagine reading a book and the author rewriting all sentences (pixel rows) below the sentence you're currently reading! -- That's what VSYNC OFF essentially is; it can interrupt what's currently unread.
Fixed refresh rate - The reader is always reading at an exact top-to-bottom speed. That reading speed never changes. The next page (or repeat-read of current page) begins again at the top edge of a page, at an mandatory fixed exact time amount after finishing the bottom of the page. The reader merrily continues at a constant rate, literally microsecond-exact.
Vertical Refresh Rate - The number of pages read per second
Horizontal Scan Rate - The rate of number of lines read per second
Vertical Blanking Interval - The reader pausing between pages
Horizontal Blanking Interval - The reader pausing between lines (rows of pixels).
Variable refresh rate - The reader will be patient between pages. The reader will be able to pause a variable amount of time between pages (patience abilities will be the VRR range that the display told the GPU that it's patient for). And begin immediately reading the new page of the book, the instant the new page is ready.