1Name 2 3 NV_triple_buffer 4 NV_quadruple_buffer 5 6Name Strings 7 8 EGL_NV_triple_buffer 9 EGL_NV_quadruple_buffer 10 11Contributors 12 13 Daniel Kartch, NVIDIA Corporation 14 Tom McReynolds, NVIDIA Corporation 15 Santanu Thangaraj, NVIDIA Corporation 16 17Contact 18 19 Daniel Kartch, NVIDIA Corporation (dkartch 'at' nvidia.com) 20 21Status 22 23 Complete. 24 25Version 26 27 Version 1 - February 28, 2019 28 29Number 30 31 133 32 33Extension Type 34 35 EGL display extension 36 37Dependencies 38 39 Requires EGL 1.0 40 41 This extension is written against the wording of the EGL 1.3 42 Specification. 43 44Overview 45 46 NV_triple_buffer and NV_quadruple_buffer allow applications to 47 request additional back buffers, in order to produce greater and 48 less variable frame rates. 49 50 This document describes two related extensions, one dependent on 51 the other. Implementations may choose to support only 52 NV_triple_buffer and not NV_quadruple_buffer, but not vice versa. 53 54New Types 55 56 None 57 58New Procedures and Functions 59 60 None 61 62New Tokens 63 64 Added by NV_triple_buffer: 65 66 Accepted as a value for EGL_RENDER_BUFFER in the <attrib_list> 67 parameter of eglCreateWindowSurface: 68 69 EGL_TRIPLE_BUFFER_NV 0x3230 70 71 Added by NV_quadruple_buffer: 72 73 Accepted as a value for EGL_RENDER_BUFFER in the <attrib_list> 74 parameter of eglCreateWindowSurface: 75 76 EGL_QUADRUPLE_BUFFER_NV 0x3231 77 78Additions to the EGL 1.3 Specification: 79 80 Insert after third sentence of second paragraph of Section 2.2.2 81 (Rendering Models): 82 83 Windows may have more than one back buffer, allowing rendering 84 of a new frame to proceed while the copy requested by 85 eglSwapBuffers is still pending. 86 87 Replace the third sentence of the EGL_RENDER_BUFFER description in 88 Section 3.5.1 (Creating On-Screen Rendering Surfaces): 89 90 If its value is EGL_BACK_BUFFER, EGL_TRIPLE_BUFFER_NV, or 91 EGL_QUADRUPLE_BUFFER_NV, then client APIs should render into 92 the current back buffer. The implementation should provide 93 at least one, two, or three back buffers, respectively, which 94 will be used in rotation each frame. 95 96 Change first sentence of third bullet point of eglQueryContext 97 description in Section 3.7.4 (Context Queries): 98 99 If the context is bound to a window surface, then either 100 EGL_SINGLE_BUFFER, EGL_BACK_BUFFER, EGL_TRIPLE_BUFFER_NV, or 101 EGL_QUADRUPLE_BUFFER_NV may be returned. 102 103 Replace first sentence of eglSwapBuffers description in 104 Section 3.9.1 105 (Posting to a Window): 106 107 If surface is a back-buffered window surface, then the current 108 color buffer is copied to the native window associated with 109 that surface. If there is more than one back buffer, then the 110 next color buffer in rotation becomes current, and rendering 111 of the next frame may proceed before the copy takes place, 112 provided any previous swaps from the new current buffer have 113 completed. 114 115Issues 116 117 1. Why do we need triple-buffering? 118 119 RESOLVED: With only a single back buffer and a non-zero swap 120 interval, eglSwapBuffers must block rendering to the back- 121 buffer until the copy has completed. This can leave the CPU 122 and/or GPU idle, wasting valuable compute time, and possibly 123 cause the next frame to be delivered later than otherwise could 124 have been. Additional buffers allow rendering to continue even 125 when a frame is awaiting display, maximizing our use of 126 computational resources. 127 128 2. Why quadruple-buffering? Isn't triple-buffering enough to 129 produce frames as fast as the processor(s) and swap interval 130 allow? 131 132 RESOLVED: When there is only a single rendering stream 133 operating on a system, triple-buffering is sufficient. However, 134 if other threads are contending for resources, variable 135 latencies may be introduced. This is especially problematic 136 with video, where any deviation in frame rate from the recorded 137 media can produce visible artifacts. Additional buffers smooth 138 out these latencies, allowing a steady frame rate. 139 140 3. Then why not arbitrary n-buffering? 141 142 RESOLVED: The TRIPLE/QUADRUPLE buffer specification fits nicely 143 into the RENDER_BUFFER attribute already in use for 144 eglCreateWindowSurface. Arbitrary buffer counts would require a 145 new attribute. Additionally, case studies indicated no 146 significant benefit to using more than three back buffers, 147 especially when factoring in the added memory cost. 148 149Revision History 150 151 #2 (February 28, 2019) Santanu Thangaraj 152 - Marked issues 1,2 and 3 as resolved. 153 - Included extension type section. 154 - Corrected line length violations. 155 156 #1 (August 12, 2008) Daniel Kartch 157 - Initial Draft 158