Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How many frames deep is a modern graphics pipeline?

Assume the pipeline is fully full: GPU waiting on vsync, GPU/driver command buffers all full, and thus user program blocked.

How many frames worth of data is in the (modern) pipeline?

For example: (4)

  1. Frame in GPU front buffer
  2. Frame in GPU back buffer
  3. Frame in GPU command buffer
  4. Frame in CPU driver command buffer
like image 927
Kay Avatar asked Nov 08 '25 18:11

Kay


1 Answers

It depends on which graphics card you're using, and which mode you've placed it in, but generally speaking, the answer is 1-3 frames (or 2-4, if you're counting the frame that is being pushed into the buffer as a frame).

  • Without Vsync or any other kind of double-buffering strategy, there's nothing mandating that any more than 1 frame be kept in memory at any given time, being overwritten as soon as a new frame is being pushed into the buffer.
  • When VSync is enabled, new frames are pushed into a second section of the frame buffer, and delay any future commands from executing until the "Vertical Sync" (hence the name, obviously) triggers, at which point the two frames are flipped.
  • A third mode, uncommon to OpenGL but familiar to Vulkan and DirectX users, called "Letterbox mode", or sometimes called "Triple Buffering", keeps two "Back Buffers" for a total of three buffers:
    • One of the back buffers is reserved for use for when the Vertical Sync triggers.
    • The other back buffer receives completed frames directly, without delays
    • Whenever a Vertical Sync occurs, the roles of these two back buffers are switched.

Note that with Triple Buffering, the Host doesn't get blocked when the buffer is full.

The GPU may choose to buffer additional frames, like in your example, though this is more common to OpenGL/DirectX11- than it is to Vulkan/DirectX12+, since in those latter APIs, the Host is being much more explicit in terms of what the GPU is supposed to do, and I can't imagine a programmer that willfully expands the frame buffer. It's not really clear what benefit it would offer beyond what Triple Buffering already offers.

like image 174
Xirema Avatar answered Nov 10 '25 16:11

Xirema



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!