102f4aeb0Sopenharmony_ciName
202f4aeb0Sopenharmony_ci
302f4aeb0Sopenharmony_ci    KHR_stream_producer_eglsurface
402f4aeb0Sopenharmony_ci
502f4aeb0Sopenharmony_ciName Strings
602f4aeb0Sopenharmony_ci
702f4aeb0Sopenharmony_ci    EGL_KHR_stream_producer_eglsurface
802f4aeb0Sopenharmony_ci
902f4aeb0Sopenharmony_ciContributors
1002f4aeb0Sopenharmony_ci
1102f4aeb0Sopenharmony_ci    Acorn Pooley
1202f4aeb0Sopenharmony_ci    Jamie Gennis
1302f4aeb0Sopenharmony_ci    Marcus Lorentzon
1402f4aeb0Sopenharmony_ci
1502f4aeb0Sopenharmony_ciContacts
1602f4aeb0Sopenharmony_ci
1702f4aeb0Sopenharmony_ci    Acorn Pooley, NVIDIA  (apooley 'at' nvidia.com)
1802f4aeb0Sopenharmony_ci
1902f4aeb0Sopenharmony_ciNotice
2002f4aeb0Sopenharmony_ci
2102f4aeb0Sopenharmony_ci    Copyright (c) 2011-2013 The Khronos Group Inc. Copyright terms at
2202f4aeb0Sopenharmony_ci        http://www.khronos.org/registry/speccopyright.html
2302f4aeb0Sopenharmony_ci
2402f4aeb0Sopenharmony_ciStatus
2502f4aeb0Sopenharmony_ci
2602f4aeb0Sopenharmony_ci    Complete.
2702f4aeb0Sopenharmony_ci    Approved by the Khronos Board of Promoters on December 2, 2011.
2802f4aeb0Sopenharmony_ci
2902f4aeb0Sopenharmony_ciVersion
3002f4aeb0Sopenharmony_ci
3102f4aeb0Sopenharmony_ci    Version 11, June 18, 2012
3202f4aeb0Sopenharmony_ci
3302f4aeb0Sopenharmony_ciNumber
3402f4aeb0Sopenharmony_ci
3502f4aeb0Sopenharmony_ci    EGL Extension #34
3602f4aeb0Sopenharmony_ci
3702f4aeb0Sopenharmony_ciDependencies
3802f4aeb0Sopenharmony_ci
3902f4aeb0Sopenharmony_ci    Requires EGL 1.2.
4002f4aeb0Sopenharmony_ci    Requires OpenGL ES 1.1 or OpenGL ES 2.0.
4102f4aeb0Sopenharmony_ci
4202f4aeb0Sopenharmony_ci    Requires the EGL_KHR_stream extension.
4302f4aeb0Sopenharmony_ci
4402f4aeb0Sopenharmony_ciOverview
4502f4aeb0Sopenharmony_ci
4602f4aeb0Sopenharmony_ci    This extension allows an EGLSurface to be created as a producer of
4702f4aeb0Sopenharmony_ci    images to an EGLStream.  Each call to eglSwapBuffers posts a new
4802f4aeb0Sopenharmony_ci    image frame into the EGLStream.
4902f4aeb0Sopenharmony_ci
5002f4aeb0Sopenharmony_ciNew Procedures and Functions
5102f4aeb0Sopenharmony_ci
5202f4aeb0Sopenharmony_ci    EGLSurface eglCreateStreamProducerSurfaceKHR(
5302f4aeb0Sopenharmony_ci                        EGLDisplay dpy,
5402f4aeb0Sopenharmony_ci                        EGLConfig config,
5502f4aeb0Sopenharmony_ci                        EGLStreamKHR stream,
5602f4aeb0Sopenharmony_ci                        const EGLint *attrib_list)
5702f4aeb0Sopenharmony_ci
5802f4aeb0Sopenharmony_ciNew Tokens
5902f4aeb0Sopenharmony_ci
6002f4aeb0Sopenharmony_ci    Bit that can appear in the EGL_SURFACE_TYPE of an EGLConfig:
6102f4aeb0Sopenharmony_ci
6202f4aeb0Sopenharmony_ci    EGL_STREAM_BIT_KHR                         0x0800
6302f4aeb0Sopenharmony_ci
6402f4aeb0Sopenharmony_ci
6502f4aeb0Sopenharmony_ci
6602f4aeb0Sopenharmony_ci
6702f4aeb0Sopenharmony_ciAdd a row to "Table 3.2: Types of surfaces supported by an EGLConfig"
6802f4aeb0Sopenharmony_ciin the EGL spec, right after the EGL_PBUFFER_BIT row:
6902f4aeb0Sopenharmony_ci
7002f4aeb0Sopenharmony_ci        EGL Token Name         Description
7102f4aeb0Sopenharmony_ci        --------------         --------------------------
7202f4aeb0Sopenharmony_ci        EGL_STREAM_BIT_KHR     EGLConfig supports streams
7302f4aeb0Sopenharmony_ci
7402f4aeb0Sopenharmony_ci
7502f4aeb0Sopenharmony_ciIn the second paragraph of section "Other EGLConfig Attribute
7602f4aeb0Sopenharmony_ciDescription" in the EGL spec, replace
7702f4aeb0Sopenharmony_ci        EGL_WINDOW_BIT | EGL_PIXMAP_BIT | EGL_PBUFFER_BIT
7802f4aeb0Sopenharmony_ciwith
7902f4aeb0Sopenharmony_ci        EGL_WINDOW_BIT | EGL_PIXMAP_BIT | EGL_PBUFFER_BIT | EGL_STREAM_BIT_KHR
8002f4aeb0Sopenharmony_ciand replace
8102f4aeb0Sopenharmony_ci        "...cannot be used to create a pbuffer or pixmap."
8202f4aeb0Sopenharmony_ciwith
8302f4aeb0Sopenharmony_ci        "...cannot be used to create a pbuffer, pixmap, or stream."
8402f4aeb0Sopenharmony_ci
8502f4aeb0Sopenharmony_ci
8602f4aeb0Sopenharmony_ciReplace section "3.10.3.1 No way to connect producer to EGLStream" in
8702f4aeb0Sopenharmony_cithe EGL_KHR_stream extension with this:
8802f4aeb0Sopenharmony_ci
8902f4aeb0Sopenharmony_ci    3.10.3.1 Stream Surface Producer
9002f4aeb0Sopenharmony_ci
9102f4aeb0Sopenharmony_ci    Call
9202f4aeb0Sopenharmony_ci
9302f4aeb0Sopenharmony_ci        EGLSurface eglCreateStreamProducerSurfaceKHR(
9402f4aeb0Sopenharmony_ci                        EGLDisplay dpy,
9502f4aeb0Sopenharmony_ci                        EGLConfig config,
9602f4aeb0Sopenharmony_ci                        EGLStreamKHR stream,
9702f4aeb0Sopenharmony_ci                        const EGLint *attrib_list)
9802f4aeb0Sopenharmony_ci
9902f4aeb0Sopenharmony_ci    to create an EGLSurface and connect it as the producer of
10002f4aeb0Sopenharmony_ci    <stream>.
10102f4aeb0Sopenharmony_ci
10202f4aeb0Sopenharmony_ci    <attrib_list> specifies a list of attributes for <stream>. The
10302f4aeb0Sopenharmony_ci    list has the same structure as described for eglChooseConfig. The
10402f4aeb0Sopenharmony_ci    attributes EGL_WIDTH and EGL_HEIGHT must both be specified in the
10502f4aeb0Sopenharmony_ci    <attrib_list>.
10602f4aeb0Sopenharmony_ci
10702f4aeb0Sopenharmony_ci    EGL_WIDTH and EGL_HEIGHT indicate the width and height
10802f4aeb0Sopenharmony_ci    (respectively) of the images that makes up the stream.
10902f4aeb0Sopenharmony_ci
11002f4aeb0Sopenharmony_ci    The EGLSurface producer inserts an image frame into <stream> once
11102f4aeb0Sopenharmony_ci    for each time it is passed to eglSwapBuffers().  The image frame
11202f4aeb0Sopenharmony_ci    is inserted after the GL has finished previous rendering commands.
11302f4aeb0Sopenharmony_ci    Refer to section "3.10.5 EGLStream operation" in the
11402f4aeb0Sopenharmony_ci    EGL_KHR_stream extension specification for operation of the
11502f4aeb0Sopenharmony_ci    EGLStream when an image frame is inserted into it.
11602f4aeb0Sopenharmony_ci
11702f4aeb0Sopenharmony_ci    If <stream> is not in the EGL_STREAM_STATE_EMPTY_KHR,
11802f4aeb0Sopenharmony_ci    EGL_STREAM_STATE_NEW_FRAME_AVAILABLE_KHR, or
11902f4aeb0Sopenharmony_ci    EGL_STREAM_STATE_OLD_FRAME_AVAILABLE_KHR when passed to
12002f4aeb0Sopenharmony_ci    eglSwapBuffers(), then eglSwapBuffers will return EGL_FALSE and
12102f4aeb0Sopenharmony_ci    generate an EGL_BAD_CURRENT_SURFACE error.
12202f4aeb0Sopenharmony_ci
12302f4aeb0Sopenharmony_ci    If the application would like to have the results of rendering
12402f4aeb0Sopenharmony_ci    appear on the screen at a particular time then it must query the
12502f4aeb0Sopenharmony_ci    value of EGL_CONSUMER_LATENCY_USEC_KHR after calling
12602f4aeb0Sopenharmony_ci    eglCreateStreamProducerSurfaceKHR.  This is the estimated time that
12702f4aeb0Sopenharmony_ci    will elapse between the time the image frame is inserted into the
12802f4aeb0Sopenharmony_ci    EGLStream and the time that the image frame will appear to the
12902f4aeb0Sopenharmony_ci    user.
13002f4aeb0Sopenharmony_ci
13102f4aeb0Sopenharmony_ci    The image frame is not inserted into the EGLStream until the GL
13202f4aeb0Sopenharmony_ci    has finished rendering it.  Therefore predicting exactly when the
13302f4aeb0Sopenharmony_ci    image frame will be inserted into the stream is nontrivial.
13402f4aeb0Sopenharmony_ci
13502f4aeb0Sopenharmony_ci    If it is critical that this frame of data reach the screen at a
13602f4aeb0Sopenharmony_ci    particular point in time, then the application can
13702f4aeb0Sopenharmony_ci        - render the frame (using GL/GLES commands)
13802f4aeb0Sopenharmony_ci        - call glFinish (or use other synchronization techniques to
13902f4aeb0Sopenharmony_ci           ensure rendering has completed).
14002f4aeb0Sopenharmony_ci        - wait until the time that the frame should appear to the user
14102f4aeb0Sopenharmony_ci           MINUS the value of EGL_CONSUMER_LATENCY_USEC_KHR.
14202f4aeb0Sopenharmony_ci        - call eglSwapBuffers
14302f4aeb0Sopenharmony_ci    This will allow the image frame to be inserted into the EGLStream
14402f4aeb0Sopenharmony_ci    at the correct time ("Image Frame Intended Display Time" minus
14502f4aeb0Sopenharmony_ci    "Consumer Latency") so that it will be displayed ("Image Frame
14602f4aeb0Sopenharmony_ci    Actual Display Time" as close as possible to the desired time.
14702f4aeb0Sopenharmony_ci
14802f4aeb0Sopenharmony_ci    However, this will cause the GPU to operate in lockstep with the
14902f4aeb0Sopenharmony_ci    CPU which can cause poor performance.  In most cases it will be
15002f4aeb0Sopenharmony_ci    more important for the image frame to appear to the user "as soon
15102f4aeb0Sopenharmony_ci    as possible" rather than at a specific point in time.  So in most
15202f4aeb0Sopenharmony_ci    cases the application can ignore the value of
15302f4aeb0Sopenharmony_ci    EGL_CONSUMER_LATENCY_USEC_KHR, not call glFinish, and not wait
15402f4aeb0Sopenharmony_ci    before calling eglSwapBuffers.
15502f4aeb0Sopenharmony_ci
15602f4aeb0Sopenharmony_ci    On failure eglCreateStreamProducerSurfaceKHR returns EGL_NO_SURFACE
15702f4aeb0Sopenharmony_ci    and generates an error.
15802f4aeb0Sopenharmony_ci
15902f4aeb0Sopenharmony_ci        - EGL_BAD_PARAMETER if EGL_WIDTH is not specified or is specified
16002f4aeb0Sopenharmony_ci          with a value less than 1.
16102f4aeb0Sopenharmony_ci
16202f4aeb0Sopenharmony_ci        - EGL_BAD_PARAMETER if EGL_HEIGHT is not specified or is specified
16302f4aeb0Sopenharmony_ci          with a value less than 1.
16402f4aeb0Sopenharmony_ci
16502f4aeb0Sopenharmony_ci        - EGL_BAD_STATE_KHR is generated if <stream> is not in state
16602f4aeb0Sopenharmony_ci          EGL_STREAM_STATE_CONNECTING_KHR.
16702f4aeb0Sopenharmony_ci
16802f4aeb0Sopenharmony_ci        - EGL_BAD_MATCH is generated if <config> does not have the
16902f4aeb0Sopenharmony_ci          EGL_STREAM_BIT_KHR set in EGL_SURFACE_TYPE.
17002f4aeb0Sopenharmony_ci
17102f4aeb0Sopenharmony_ci        - EGL_BAD_MATCH is generated if the implementation is not able to
17202f4aeb0Sopenharmony_ci          convert color buffers described by <config> into image frames
17302f4aeb0Sopenharmony_ci          that are acceptable by the consumer that is connected to
17402f4aeb0Sopenharmony_ci          <stream>.
17502f4aeb0Sopenharmony_ci
17602f4aeb0Sopenharmony_ci        - EGL_BAD_STREAM_KHR is generated if <stream> is not a valid
17702f4aeb0Sopenharmony_ci          EGLStream created for <dpy>.
17802f4aeb0Sopenharmony_ci
17902f4aeb0Sopenharmony_ci        - EGL_BAD_DISPLAY is generated if <dpy> is not a valid,
18002f4aeb0Sopenharmony_ci          initialized EGLDisplay.
18102f4aeb0Sopenharmony_ci
18202f4aeb0Sopenharmony_ciAdd a section preceding "3.9.3 Posting Semantics" in the EGL
18302f4aeb0Sopenharmony_cispecification:
18402f4aeb0Sopenharmony_ci
18502f4aeb0Sopenharmony_ci    3.9.x Posting to a Stream
18602f4aeb0Sopenharmony_ci
18702f4aeb0Sopenharmony_ci    To post the color buffer to an EGLStream with an EGLSurface
18802f4aeb0Sopenharmony_ci    producer, call
18902f4aeb0Sopenharmony_ci
19002f4aeb0Sopenharmony_ci        EGLBoolean eglSwapBuffers(
19102f4aeb0Sopenharmony_ci                            EGLDisplay dpy,
19202f4aeb0Sopenharmony_ci                            EGLSurface surface);
19302f4aeb0Sopenharmony_ci
19402f4aeb0Sopenharmony_ci    If <surface> is the producer of an EGLStream then the
19502f4aeb0Sopenharmony_ci    contents of the color buffer are inserted as a new image frame
19602f4aeb0Sopenharmony_ci    into the EGLStream.
19702f4aeb0Sopenharmony_ci
19802f4aeb0Sopenharmony_ci    When eglSwapBuffers returns the contents of the color buffer will
19902f4aeb0Sopenharmony_ci    have been inserted into the EGLStream as described in section
20002f4aeb0Sopenharmony_ci    "3.10.5 EGLStream operation" in the EGL_KHR_stream extension
20102f4aeb0Sopenharmony_ci    specification, and the EGL_PRODUCER_FRAME_KHR attribute and
20202f4aeb0Sopenharmony_ci    EGL_STREAM_STATE_KHR attribute values will reflect this.
20302f4aeb0Sopenharmony_ci
20402f4aeb0Sopenharmony_ci    The contents of the color buffer and all ancillary buffers are
20502f4aeb0Sopenharmony_ci    always undefined after calling eglSwapBuffers.
20602f4aeb0Sopenharmony_ci
20702f4aeb0Sopenharmony_ci    eglSwapBuffers is never synchronized to a video frame when
20802f4aeb0Sopenharmony_ci    <surface> is the producer for an EGLStream (it is as if the
20902f4aeb0Sopenharmony_ci    swapinterval (set by eglSwapInterval, see below section "3.9.3
21002f4aeb0Sopenharmony_ci    Posting Semantics") is 0).
21102f4aeb0Sopenharmony_ci
21202f4aeb0Sopenharmony_ci    It is implementation dependent whether eglSwapBuffers actually
21302f4aeb0Sopenharmony_ci    waits for rendering to the color buffer to complete before
21402f4aeb0Sopenharmony_ci    returning, but except for timing it must appear to the application
21502f4aeb0Sopenharmony_ci    that all rendering to the EGLSurface (e.g. all previous gl
21602f4aeb0Sopenharmony_ci    commands) completed before the image frame was inserted into the
21702f4aeb0Sopenharmony_ci    EGLStream and eglSwapBuffers returned (as described below in
21802f4aeb0Sopenharmony_ci    section "3.9.3 Posting Semantics").
21902f4aeb0Sopenharmony_ci
22002f4aeb0Sopenharmony_ci
22102f4aeb0Sopenharmony_ciAdd to section "3.9.4 Posting Errors" in the EGL specification a new
22202f4aeb0Sopenharmony_cisentence as the 2nd to last sentence in the first paragraph:
22302f4aeb0Sopenharmony_ci
22402f4aeb0Sopenharmony_ci    If eglSwapBuffers is called and the EGLStream associated with
22502f4aeb0Sopenharmony_ci    surface is no longer valid, an EGL_BAD_STREAM_KHR error is
22602f4aeb0Sopenharmony_ci    generated.
22702f4aeb0Sopenharmony_ci
22802f4aeb0Sopenharmony_ci
22902f4aeb0Sopenharmony_ciIssues
23002f4aeb0Sopenharmony_ci    1.  How many image frame buffers should be used?
23102f4aeb0Sopenharmony_ci
23202f4aeb0Sopenharmony_ci        DISCUSSION:
23302f4aeb0Sopenharmony_ci        - leave up to implementation?
23402f4aeb0Sopenharmony_ci        - leave up to producer?
23502f4aeb0Sopenharmony_ci        - need hints from consumer?
23602f4aeb0Sopenharmony_ci        - In practice 1, 2, and 3 buffers mean different semantics
23702f4aeb0Sopenharmony_ci          which are visible to both the producer and consumer.  Each
23802f4aeb0Sopenharmony_ci          may be useful.  I cannot think of a use for more than 3
23902f4aeb0Sopenharmony_ci          buffers for EGL_KHR_stream_surface.  (For a video producer
24002f4aeb0Sopenharmony_ci          more than 3 often does make sense, but that is a different
24102f4aeb0Sopenharmony_ci          extension.)
24202f4aeb0Sopenharmony_ci
24302f4aeb0Sopenharmony_ci        One possibility: expose EGL_BUFFER_COUNT_KHR to application.
24402f4aeb0Sopenharmony_ci
24502f4aeb0Sopenharmony_ci        It probably does not make sense to ever use more or less than
24602f4aeb0Sopenharmony_ci        3 buffers.  One that is the EGLSurface back buffer.  One that
24702f4aeb0Sopenharmony_ci        is waiting for the consumer to acquire.  And one that the
24802f4aeb0Sopenharmony_ci        consumer has acquired and is actively consuming.
24902f4aeb0Sopenharmony_ci
25002f4aeb0Sopenharmony_ci        RESOLVED: remove the EGL_BUFFER_COUNT_KHR parameter and always
25102f4aeb0Sopenharmony_ci        use 3 buffers.  This attribute can be added back with a
25202f4aeb0Sopenharmony_ci        layered extension later if needed.
25302f4aeb0Sopenharmony_ci
25402f4aeb0Sopenharmony_ci    2.  How is the resolution (width/height) of image frames set?
25502f4aeb0Sopenharmony_ci
25602f4aeb0Sopenharmony_ci        RESOLVED: The width and height are set with the required
25702f4aeb0Sopenharmony_ci        EGL_WIDTH and EGL_HEIGHT attributes.  These do not change for
25802f4aeb0Sopenharmony_ci        the life of <stream>.
25902f4aeb0Sopenharmony_ci
26002f4aeb0Sopenharmony_ci    3.  How is the image format, zbuffering, etc set?
26102f4aeb0Sopenharmony_ci
26202f4aeb0Sopenharmony_ci        RESOLVED: These are all determined by the <config>.  These do
26302f4aeb0Sopenharmony_ci        not change for the life of <stream>.
26402f4aeb0Sopenharmony_ci
26502f4aeb0Sopenharmony_ci    4.  How does eglSwapBuffers act if there are already image frames
26602f4aeb0Sopenharmony_ci        in the EGLStream when it is called.
26702f4aeb0Sopenharmony_ci
26802f4aeb0Sopenharmony_ci        RESOLVED: Frames are inserted into the EGLStream as described
26902f4aeb0Sopenharmony_ci        in section "3.10.5 EGLStream operation" in the EGL_KHR_stream
27002f4aeb0Sopenharmony_ci        extension specification.  In particular:
27102f4aeb0Sopenharmony_ci
27202f4aeb0Sopenharmony_ci            If the value of EGL_STREAM_FIFO_LENGTH_KHR is 0 or if the
27302f4aeb0Sopenharmony_ci            EGL_KHR_stream_fifo extension is not supported then the
27402f4aeb0Sopenharmony_ci            new frame replaces any frames that already exist in the
27502f4aeb0Sopenharmony_ci            EGLStream.  If the consumer is already consuming a frame
27602f4aeb0Sopenharmony_ci            then it continues to consume that same frame, but the next
27702f4aeb0Sopenharmony_ci            time the consumer begins to consume a frame (e.g. the
27802f4aeb0Sopenharmony_ci            next time eglStreamConsumerAcquireKHR() is called for a
27902f4aeb0Sopenharmony_ci            gltexture consumer) the newly rendered image frame will be
28002f4aeb0Sopenharmony_ci            consumed.  (This is the standard behavior for ANY producer
28102f4aeb0Sopenharmony_ci            when EGL_STREAM_FIFO_LENGTH_KHR is 0, described as "mailbox
28202f4aeb0Sopenharmony_ci            mode").
28302f4aeb0Sopenharmony_ci
28402f4aeb0Sopenharmony_ci            If the EGL_KHR_stream_fifo extension is supported and the
28502f4aeb0Sopenharmony_ci            value of EGL_STREAM_FIFO_LENGTH_KHR is greater than 0 then
28602f4aeb0Sopenharmony_ci            the newly rendered frame will be inserted into the
28702f4aeb0Sopenharmony_ci            EGLStream.  If the EGLStream is full (already contains
28802f4aeb0Sopenharmony_ci            EGL_STREAM_FIFO_LENGTH_KHR frames) then eglSwapBuffers
28902f4aeb0Sopenharmony_ci            will block until there is room in the fifo.  Note that
29002f4aeb0Sopenharmony_ci            this can deadlock if the consumer is running in the same
29102f4aeb0Sopenharmony_ci            thread as the producer since the consumer will never be
29202f4aeb0Sopenharmony_ci            able to consume a frame if the thread is blocked waiting
29302f4aeb0Sopenharmony_ci            for room in the fifo.  This fifo-related behavior is
29402f4aeb0Sopenharmony_ci            described in the EGL_KHR_stream_fifo specification (this
29502f4aeb0Sopenharmony_ci            behavior is not specific to this producer; it works the
29602f4aeb0Sopenharmony_ci            same for all producers and all consumers).
29702f4aeb0Sopenharmony_ci
29802f4aeb0Sopenharmony_ci        All rendering commands must complete before the color
29902f4aeb0Sopenharmony_ci        buffer is inserted into the EGLStream, or at least this is how
30002f4aeb0Sopenharmony_ci        the behavior must appear to the application.
30102f4aeb0Sopenharmony_ci
30202f4aeb0Sopenharmony_ci        To be precise: when eglSwapBuffers returns the rendering
30302f4aeb0Sopenharmony_ci        commands may or may not actually be complete, but the
30402f4aeb0Sopenharmony_ci        following must all be true:
30502f4aeb0Sopenharmony_ci            - The EGL_PRODUCER_FRAME_KHR value reflects the frame that
30602f4aeb0Sopenharmony_ci                was just swapped by eglSwapBuffers
30702f4aeb0Sopenharmony_ci            - The EGL_STREAM_STATE_KHR indicates that the image frame
30802f4aeb0Sopenharmony_ci                is available (i.e. its value is
30902f4aeb0Sopenharmony_ci                EGL_STREAM_STATE_NEW_FRAME_AVAILABLE_KHR)
31002f4aeb0Sopenharmony_ci            - In mailbox mode if the consumer consumes a new frame it
31102f4aeb0Sopenharmony_ci                will get this new frame (not an older frame).  (For
31202f4aeb0Sopenharmony_ci                example, with a EGL_NV_stream_consumer_gltexture
31302f4aeb0Sopenharmony_ci                consumer, a call to eglStreamConsumerAcquireKHR() will
31402f4aeb0Sopenharmony_ci                latch this new frame.)
31502f4aeb0Sopenharmony_ci            - In fifo mode (see EGL_KHR_stream_fifo extension) if the
31602f4aeb0Sopenharmony_ci                consumer consumes a new frame and all previous frames
31702f4aeb0Sopenharmony_ci                have been consumed it will get this new frame (not an
31802f4aeb0Sopenharmony_ci                older frame).  (For example, with a
31902f4aeb0Sopenharmony_ci                EGL_NV_stream_consumer_gltexture consumer, a call to
32002f4aeb0Sopenharmony_ci                eglStreamConsumerAcquireKHR() will latch this new
32102f4aeb0Sopenharmony_ci                frame.)
32202f4aeb0Sopenharmony_ci            - If a consumer consumes the swapped frame, all GL (and
32302f4aeb0Sopenharmony_ci                other API) commands called prior to eglSwapBuffers
32402f4aeb0Sopenharmony_ci                will take effect on the image frame before the
32502f4aeb0Sopenharmony_ci                consumer consumes it.  In other words, the consumer
32602f4aeb0Sopenharmony_ci                will never consume a partially rendered frame.  (For
32702f4aeb0Sopenharmony_ci                example, with EGL_NV_stream_consumer_gltexture
32802f4aeb0Sopenharmony_ci                consumer, if the app does this:
32902f4aeb0Sopenharmony_ci                    eglSwapBuffers()               // swap the producer EGLSurface
33002f4aeb0Sopenharmony_ci                    eglStreamConsumerAcquireKHR()  // acquire the swapped image
33102f4aeb0Sopenharmony_ci                    glDrawArrays()                 // draw something using the texture
33202f4aeb0Sopenharmony_ci                then the texture used in the glDrawArrays() command
33302f4aeb0Sopenharmony_ci                will contain the image rendered by all gl (and/or
33402f4aeb0Sopenharmony_ci                other API) commands preceding the eglSwapBuffers call
33502f4aeb0Sopenharmony_ci                as if the app had called glFinish and/or eglWaitClient
33602f4aeb0Sopenharmony_ci                just before calling eglSwapBuffers (but note that this
33702f4aeb0Sopenharmony_ci                is implicit in eglSwapBuffers; the app does NOT need
33802f4aeb0Sopenharmony_ci                to actually call glFinish or any other synchronization
33902f4aeb0Sopenharmony_ci                functions in order to get this effect, and in fact
34002f4aeb0Sopenharmony_ci                explicitly calling glFinish and/or eglWaitClient there
34102f4aeb0Sopenharmony_ci                may significantly and negatively affect performance).)
34202f4aeb0Sopenharmony_ci
34302f4aeb0Sopenharmony_ciRevision History
34402f4aeb0Sopenharmony_ci
34502f4aeb0Sopenharmony_ci    #11 (June 18. 2012) Acorn Pooley
34602f4aeb0Sopenharmony_ci        - Replace EGLStream with EGLStreamKHR in function prototypes.
34702f4aeb0Sopenharmony_ci
34802f4aeb0Sopenharmony_ci    #10 (June 15, 2012) Acorn Pooley
34902f4aeb0Sopenharmony_ci        - Fix eglCreateStreamProducerSurfaceKHR name (was missing KHR)
35002f4aeb0Sopenharmony_ci
35102f4aeb0Sopenharmony_ci    #9 (October 17, 2011) Acorn Pooley
35202f4aeb0Sopenharmony_ci        - Clarify issue 4
35302f4aeb0Sopenharmony_ci
35402f4aeb0Sopenharmony_ci    #8 (October 12, 2011) Acorn Pooley
35502f4aeb0Sopenharmony_ci        - remove interactions with EGL_KHR_stream_fifo extension (they
35602f4aeb0Sopenharmony_ci          are already decribed in that extension).
35702f4aeb0Sopenharmony_ci
35802f4aeb0Sopenharmony_ci    #7 (October 11, 2011) Acorn Pooley
35902f4aeb0Sopenharmony_ci        - Add issue 4
36002f4aeb0Sopenharmony_ci        - add changes to section 3.9 of the EGL spec to clarify
36102f4aeb0Sopenharmony_ci          eglSwapBuffer behavior
36202f4aeb0Sopenharmony_ci
36302f4aeb0Sopenharmony_ci    #6 (October 4, 2011) Acorn Pooley
36402f4aeb0Sopenharmony_ci        - Convert from an NV extension to a KHR extension
36502f4aeb0Sopenharmony_ci
36602f4aeb0Sopenharmony_ci    #5 (September 30, 2011) Acorn Pooley
36702f4aeb0Sopenharmony_ci        - Remove EGL_BUFFER_COUNT_NV (0x321D) attribute and resolve issue 1.
36802f4aeb0Sopenharmony_ci
36902f4aeb0Sopenharmony_ci    #4 (September 27, 2011) Acorn Pooley
37002f4aeb0Sopenharmony_ci        - Assign enum values (bug 8064)
37102f4aeb0Sopenharmony_ci
37202f4aeb0Sopenharmony_ci    #3 (July 6, 2011) Acorn Pooley
37302f4aeb0Sopenharmony_ci        - Rename EGL_KHR_image_stream to EGL_KHR_stream
37402f4aeb0Sopenharmony_ci
37502f4aeb0Sopenharmony_ci    #2  (June 30, 2011) Acorn Pooley
37602f4aeb0Sopenharmony_ci        - remove dependence on EGLImage
37702f4aeb0Sopenharmony_ci        - clarify overview
37802f4aeb0Sopenharmony_ci        - remove glossary (it can be seen in EGL_KHR_stream ext)
37902f4aeb0Sopenharmony_ci        - Add EGL_STREAM_BIT
38002f4aeb0Sopenharmony_ci        - clarify description
38102f4aeb0Sopenharmony_ci        - describe attribute
38202f4aeb0Sopenharmony_ci
38302f4aeb0Sopenharmony_ci    #1  (April 20, 2011) Acorn Pooley
38402f4aeb0Sopenharmony_ci        - initial draft
38502f4aeb0Sopenharmony_ci
38602f4aeb0Sopenharmony_ci# vim:ai:ts=4:sts=4:expandtab:textwidth=70
387