summaryrefslogtreecommitdiff
path: root/glew/auto/EGL-Registry/extensions/NV/EGL_NV_n_buffer.txt
blob: 900465217b2c181eb1f2a3e41d281637cbcba9a3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
Name

    NV_triple_buffer
    NV_quadruple_buffer

Name Strings

    EGL_NV_triple_buffer
    EGL_NV_quadruple_buffer

Contributors

    Daniel Kartch, NVIDIA Corporation
    Tom McReynolds, NVIDIA Corporation
    Santanu Thangaraj, NVIDIA Corporation

Contact

    Daniel Kartch, NVIDIA Corporation (dkartch 'at' nvidia.com)

Status

    Complete.

Version

    Version 1 - February 28, 2019

Number

    133

Extension Type

    EGL display extension

Dependencies

    Requires EGL 1.0

    This extension is written against the wording of the EGL 1.3
    Specification.

Overview

    NV_triple_buffer and NV_quadruple_buffer allow applications to
    request additional back buffers, in order to produce greater and
    less variable frame rates.

    This document describes two related extensions, one dependent on
    the other. Implementations may choose to support only
    NV_triple_buffer and not NV_quadruple_buffer, but not vice versa.

New Types

    None

New Procedures and Functions

    None

New Tokens

    Added by NV_triple_buffer:

      Accepted as a value for EGL_RENDER_BUFFER in the <attrib_list>
      parameter of eglCreateWindowSurface:

          EGL_TRIPLE_BUFFER_NV                    0x3230

    Added by NV_quadruple_buffer:

      Accepted as a value for EGL_RENDER_BUFFER in the <attrib_list>
      parameter of eglCreateWindowSurface:

          EGL_QUADRUPLE_BUFFER_NV                 0x3231

Additions to the EGL 1.3 Specification:

    Insert after third sentence of second paragraph of Section 2.2.2
    (Rendering Models):

        Windows may have more than one back buffer, allowing rendering
        of a new frame to proceed while the copy requested by 
        eglSwapBuffers is still pending.

    Replace the third sentence of the EGL_RENDER_BUFFER description in
    Section 3.5.1 (Creating On-Screen Rendering Surfaces):

        If its value is EGL_BACK_BUFFER, EGL_TRIPLE_BUFFER_NV, or
        EGL_QUADRUPLE_BUFFER_NV, then client APIs should render into
        the current back buffer. The implementation should provide
        at least one, two, or three back buffers, respectively, which
        will be used in rotation each frame.

    Change first sentence of third bullet point of eglQueryContext
    description in Section 3.7.4 (Context Queries):

        If the context is bound to a window surface, then either
        EGL_SINGLE_BUFFER, EGL_BACK_BUFFER, EGL_TRIPLE_BUFFER_NV, or
        EGL_QUADRUPLE_BUFFER_NV may be returned.

    Replace first sentence of eglSwapBuffers description in
    Section 3.9.1
    (Posting to a Window):

        If surface is a back-buffered window surface, then the current
        color buffer is copied to the native window associated with
        that surface. If there is more than one back buffer, then the
        next color buffer in rotation becomes current, and rendering
        of the next frame may proceed before the copy takes place,
        provided any previous swaps from the new current buffer have
        completed.

Issues

    1. Why do we need triple-buffering?

       RESOLVED: With only a single back buffer and a non-zero swap
       interval, eglSwapBuffers must block rendering to the back-
       buffer until the copy has completed. This can leave the CPU
       and/or GPU idle, wasting valuable compute time, and possibly
       cause the next frame to be delivered later than otherwise could
       have been. Additional buffers allow rendering to continue even
       when a frame is awaiting display, maximizing our use of
       computational resources.

    2. Why quadruple-buffering? Isn't triple-buffering enough to
       produce frames as fast as the processor(s) and swap interval
       allow?

       RESOLVED: When there is only a single rendering stream
       operating on a system, triple-buffering is sufficient. However,
       if other threads are contending for resources, variable 
       latencies may be introduced. This is especially problematic
       with video, where any deviation in frame rate from the recorded
       media can produce visible artifacts. Additional buffers smooth
       out these latencies, allowing a steady frame rate.

    3. Then why not arbitrary n-buffering?

       RESOLVED: The TRIPLE/QUADRUPLE buffer specification fits nicely
       into the RENDER_BUFFER attribute already in use for
       eglCreateWindowSurface. Arbitrary buffer counts would require a
       new attribute. Additionally, case studies indicated no
       significant benefit to using more than three back buffers,
       especially when factoring in the added memory cost.

Revision History

    #2 (February 28, 2019) Santanu Thangaraj
       - Marked issues 1,2 and 3 as resolved.
       - Included extension type section.
       - Corrected line length violations.

    #1 (August 12, 2008) Daniel Kartch
       - Initial Draft