15bd8deadSopenharmony_ciName
25bd8deadSopenharmony_ci
35bd8deadSopenharmony_ci    OVR_multiview
45bd8deadSopenharmony_ci
55bd8deadSopenharmony_ciName Strings
65bd8deadSopenharmony_ci
75bd8deadSopenharmony_ci    GL_OVR_multiview
85bd8deadSopenharmony_ci
95bd8deadSopenharmony_ciContact
105bd8deadSopenharmony_ci
115bd8deadSopenharmony_ci    Cass Everitt, Oculus (cass.everitt 'at' oculus.com)
125bd8deadSopenharmony_ci
135bd8deadSopenharmony_ciContributors
145bd8deadSopenharmony_ci
155bd8deadSopenharmony_ci    John Carmack, Oculus
165bd8deadSopenharmony_ci    Tom Forsyth, Oculus
175bd8deadSopenharmony_ci    Maurice Ribble, Qualcomm
185bd8deadSopenharmony_ci    James Dolan, NVIDIA Corporation
195bd8deadSopenharmony_ci    Mark Kilgard, NVIDIA Corporation
205bd8deadSopenharmony_ci    Michael Songy, NVIDIA Corporation
215bd8deadSopenharmony_ci    Yury Uralsky, NVIDIA Corporation
225bd8deadSopenharmony_ci    Jesse Hall, Google
235bd8deadSopenharmony_ci    Timothy Lottes, Epic
245bd8deadSopenharmony_ci    Jan-Harald Fredriksen, ARM
255bd8deadSopenharmony_ci    Jonas Gustavsson, Sony Mobile
265bd8deadSopenharmony_ci    Sam Holmes, Qualcomm
275bd8deadSopenharmony_ci    Nigel Williams, Qualcomm
285bd8deadSopenharmony_ci    Tobias Hector, Imagination Technologies
295bd8deadSopenharmony_ci    Daniel Koch, NVIDIA Corporation
305bd8deadSopenharmony_ci    James Helferty, NVIDIA Corporation
315bd8deadSopenharmony_ci    Olli Etuaho, NVIDIA Corporation
325bd8deadSopenharmony_ci
335bd8deadSopenharmony_ciStatus
345bd8deadSopenharmony_ci
355bd8deadSopenharmony_ci    Complete.
365bd8deadSopenharmony_ci
375bd8deadSopenharmony_ciVersion
385bd8deadSopenharmony_ci
395bd8deadSopenharmony_ci    Last Modified Date: October 19, 2018
405bd8deadSopenharmony_ci    Revision: 6
415bd8deadSopenharmony_ci
425bd8deadSopenharmony_ciNumber
435bd8deadSopenharmony_ci
445bd8deadSopenharmony_ci    OpenGL Extension #478
455bd8deadSopenharmony_ci    OpenGL ES Extension #241
465bd8deadSopenharmony_ci
475bd8deadSopenharmony_ciDependencies
485bd8deadSopenharmony_ci
495bd8deadSopenharmony_ci    OpenGL 3.0 or OpenGL ES 3.0 is required.
505bd8deadSopenharmony_ci
515bd8deadSopenharmony_ci    This extension is written against the OpenGL ES 3.2 (November 3, 2016)
525bd8deadSopenharmony_ci    specification and the OpenGL 4.6 (Core Profile) (July 30, 2017)
535bd8deadSopenharmony_ci
545bd8deadSopenharmony_ci    This extension is written against the OpenGL ES Shading Language 3.00.04
555bd8deadSopenharmony_ci    specification.
565bd8deadSopenharmony_ci
575bd8deadSopenharmony_ci    This extension interacts with OpenGL 3.3, ARB_timer_query, and
585bd8deadSopenharmony_ci    EXT_disjoint_timer_query.
595bd8deadSopenharmony_ci
605bd8deadSopenharmony_ci    This extension interacts with OpenGL 4.5, ARB_direct_state_access and
615bd8deadSopenharmony_ci    EXT_direct_state_access.
625bd8deadSopenharmony_ci
635bd8deadSopenharmony_ci    This extension interacts with OpenGL ES 3.2, OpenGL 4.0,
645bd8deadSopenharmony_ci    EXT_tessellation_shader, OES_tessellation_shader, and
655bd8deadSopenharmony_ci    ARB_tessellation_shader.
665bd8deadSopenharmony_ci
675bd8deadSopenharmony_ci    This extension interacts with OpenGL ES 3.2, OpenGL 3.2,
685bd8deadSopenharmony_ci    EXT_geometry_shader, OES_geometry_shader and ARB_geometry_shader4
695bd8deadSopenharmony_ci
705bd8deadSopenharmony_ci    This extension interacts with OpenGL 4.3, ARB_multi_draw_indirect, and
715bd8deadSopenharmony_ci    EXT_multi_draw_indirect.
725bd8deadSopenharmony_ci
735bd8deadSopenharmony_ci    This extension interacts with OpenGL 3.0, the OpenGL 3.0 Compatibility
745bd8deadSopenharmony_ci    Profile, and ARB_fragment_layer_viewport.
755bd8deadSopenharmony_ci
765bd8deadSopenharmony_ciOverview
775bd8deadSopenharmony_ci
785bd8deadSopenharmony_ci    The method of stereo rendering supported in OpenGL is currently achieved by
795bd8deadSopenharmony_ci    rendering to the two eye buffers sequentially.  This typically incurs double
805bd8deadSopenharmony_ci    the application and driver overhead, despite the fact that the command
815bd8deadSopenharmony_ci    streams and render states are almost identical.
825bd8deadSopenharmony_ci
835bd8deadSopenharmony_ci    This extension seeks to address the inefficiency of sequential multiview
845bd8deadSopenharmony_ci    rendering by adding a means to render to multiple elements of a 2D texture
855bd8deadSopenharmony_ci    array simultaneously.  In multiview rendering, draw calls are instanced into
865bd8deadSopenharmony_ci    each corresponding element of the texture array.  The vertex program uses a
875bd8deadSopenharmony_ci    new gl_ViewID_OVR variable to compute per-view values, typically the vertex
885bd8deadSopenharmony_ci    position and view-dependent variables like reflection.
895bd8deadSopenharmony_ci
905bd8deadSopenharmony_ci    The formulation of this extension is high level in order to allow
915bd8deadSopenharmony_ci    implementation freedom.  On existing hardware, applications and drivers can
925bd8deadSopenharmony_ci    realize the benefits of a single scene traversal, even if all GPU work is
935bd8deadSopenharmony_ci    fully duplicated per-view.  But future support could enable simultaneous
945bd8deadSopenharmony_ci    rendering via multi-GPU, tile-based architectures could sort geometry into
955bd8deadSopenharmony_ci    tiles for multiple views in a single pass, and the implementation could even
965bd8deadSopenharmony_ci    choose to interleave at the fragment level for better texture cache
975bd8deadSopenharmony_ci    utilization and more coherent fragment shader branching.
985bd8deadSopenharmony_ci
995bd8deadSopenharmony_ci    The most obvious use case in this model is to support two simultaneous
1005bd8deadSopenharmony_ci    views: one view for each eye.  However, we also anticipate a usage where two
1015bd8deadSopenharmony_ci    views are rendered per eye, where one has a wide field of view and the other
1025bd8deadSopenharmony_ci    has a narrow one.  The nature of wide field of view planar projection is
1035bd8deadSopenharmony_ci    that the sample density can become unacceptably low in the view direction.
1045bd8deadSopenharmony_ci    By rendering two inset eye views per eye, we can get the required sample
1055bd8deadSopenharmony_ci    density in the center of projection without wasting samples, memory, and
1065bd8deadSopenharmony_ci    time by oversampling in the periphery.
1075bd8deadSopenharmony_ci
1085bd8deadSopenharmony_ci
1095bd8deadSopenharmony_ciNew Tokens
1105bd8deadSopenharmony_ci
1115bd8deadSopenharmony_ci    Accepted by the <pname> parameter of GetFramebufferAttachmentParameteriv:
1125bd8deadSopenharmony_ci
1135bd8deadSopenharmony_ci        FRAMEBUFFER_ATTACHMENT_TEXTURE_NUM_VIEWS_OVR               0x9630
1145bd8deadSopenharmony_ci        FRAMEBUFFER_ATTACHMENT_TEXTURE_BASE_VIEW_INDEX_OVR         0x9632
1155bd8deadSopenharmony_ci
1165bd8deadSopenharmony_ci    Accepted by the <pname> parameter of GetIntegerv:
1175bd8deadSopenharmony_ci
1185bd8deadSopenharmony_ci        MAX_VIEWS_OVR                                              0x9631
1195bd8deadSopenharmony_ci
1205bd8deadSopenharmony_ci    Returned by CheckFramebufferStatus:
1215bd8deadSopenharmony_ci
1225bd8deadSopenharmony_ci        FRAMEBUFFER_INCOMPLETE_VIEW_TARGETS_OVR                    0x9633
1235bd8deadSopenharmony_ci
1245bd8deadSopenharmony_ci
1255bd8deadSopenharmony_ciNew Procedures and Functions
1265bd8deadSopenharmony_ci
1275bd8deadSopenharmony_ci    void FramebufferTextureMultiviewOVR( enum target, enum attachment,
1285bd8deadSopenharmony_ci                                         uint texture, int level,
1295bd8deadSopenharmony_ci                                         int baseViewIndex, sizei numViews );
1305bd8deadSopenharmony_ci
1315bd8deadSopenharmony_ci    [[ If OpenGL 4.5 or ARB_direct_state_access is supported ]]
1325bd8deadSopenharmony_ci
1335bd8deadSopenharmony_ci    void NamedFramebufferTextureMultiviewOVR( uint framebuffer, enum attachment,
1345bd8deadSopenharmony_ci                                              uint texture, int level,
1355bd8deadSopenharmony_ci                                              int baseViewIndex, sizei numViews );
1365bd8deadSopenharmony_ci
1375bd8deadSopenharmony_ci
1385bd8deadSopenharmony_ciModifications to Chapter 4 of the OpenGL 4.6 Specification (Event Model)
1395bd8deadSopenharmony_ci
1405bd8deadSopenharmony_ci    Modify section 4.3 (Time Queries) adding the following to the list
1415bd8deadSopenharmony_ci    of errors:
1425bd8deadSopenharmony_ci
1435bd8deadSopenharmony_ci    "Queries where BeginQuery or EndQuery is called with a target of
1445bd8deadSopenharmony_ci    TIME_ELAPSED, or a if QueryCounter is called with a target of TIMESTAMP
1455bd8deadSopenharmony_ci    return undefined values if the draw framebuffer is multiview at any
1465bd8deadSopenharmony_ci    point during their execution."
1475bd8deadSopenharmony_ci
1485bd8deadSopenharmony_ciModifications to Chapter 9 of the OpenGL ES 3.2 Specification (Framebuffers
1495bd8deadSopenharmony_ciand Framebuffer Objects)
1505bd8deadSopenharmony_ci
1515bd8deadSopenharmony_ci    Add a new subsection to section 9.2.2 (Attaching Images to Framebuffer
1525bd8deadSopenharmony_ci    Objects):
1535bd8deadSopenharmony_ci
1545bd8deadSopenharmony_ci    "9.2.2.2 (Multiview Images)
1555bd8deadSopenharmony_ci
1565bd8deadSopenharmony_ci    Finally, multiple layers of two-dimensional array textures can be
1575bd8deadSopenharmony_ci    attached to an attachment point. Such attachments represent multiple
1585bd8deadSopenharmony_ci    views, and the corresponding attachment point is considered to be
1595bd8deadSopenharmony_ci    _multiview_.
1605bd8deadSopenharmony_ci
1615bd8deadSopenharmony_ci    In this mode there are several restrictions:
1625bd8deadSopenharmony_ci
1635bd8deadSopenharmony_ci        - in vertex shader gl_Position is the only output that can depend on
1645bd8deadSopenharmony_ci          gl_ViewID_OVR (see Section 7.1 of the OpenGL ES Shading Language
1655bd8deadSopenharmony_ci          specification)
1665bd8deadSopenharmony_ci        - no transform feedback (section 11.1.3.11))
1675bd8deadSopenharmony_ci        - no tessellation control or evaluation shaders (section 11.1.3.11)
1685bd8deadSopenharmony_ci        - no geometry shader (section 11.1.3.11)
1695bd8deadSopenharmony_ci        - no timer queries (section 4.3)
1705bd8deadSopenharmony_ci        - occlusion query results must be between max per-view and the sum
1715bd8deadSopenharmony_ci          of the per-view queries, inclusive (section 15.1.4)."
1725bd8deadSopenharmony_ci        - in fragment shader the contents of gl_Layer are undefined
1735bd8deadSopenharmony_ci
1745bd8deadSopenharmony_ci    [[ If implemented in OpenGL ]]
1755bd8deadSopenharmony_ci        - the number of views rendered to by Begin/End is an undefined subset
1765bd8deadSopenharmony_ci          of the views present in the framebuffer
1775bd8deadSopenharmony_ci
1785bd8deadSopenharmony_ci    Add the following to list of <pname> parameters which can be queried
1795bd8deadSopenharmony_ci    via GetFramebufferAttachmentParameteriv when the value of
1805bd8deadSopenharmony_ci    FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE is TEXTURE in section 9.2.3
1815bd8deadSopenharmony_ci    (Framebuffer Object Queries):
1825bd8deadSopenharmony_ci
1835bd8deadSopenharmony_ci    "If <pname> is FRAMEBUFFER_ATTACHMENT_TEXTURE_NUM_VIEWS_OVR and the value
1845bd8deadSopenharmony_ci    of FRAMEBUFFER_ATTACHMENT_OBJECT_NAME is a two-dimensional array texture,
1855bd8deadSopenharmony_ci    then <params> will contain the number of views that were specified for the
1865bd8deadSopenharmony_ci    attachment point via FramebufferTextureMultiviewOVR. Otherwise, <params>
1875bd8deadSopenharmony_ci    will contain zero.
1885bd8deadSopenharmony_ci
1895bd8deadSopenharmony_ci    "If <pname> is FRAMEBUFFER_ATTACHMENT_TEXTURE_BASE_VIEW_INDEX_OVR and the
1905bd8deadSopenharmony_ci    value of FRAMEBUFFER_ATTACHMENT_OBJECT_NAME is a two-dimensional array
1915bd8deadSopenharmony_ci    texture, then <params> will contain the base view index that was specified
1925bd8deadSopenharmony_ci    for the attachment point via FramebufferTextureMultiviewOVR. Otherwise,
1935bd8deadSopenharmony_ci    <params> will contain zero."
1945bd8deadSopenharmony_ci
1955bd8deadSopenharmony_ci    Add the following to the end of section 9.2.8 (Attaching Textures to a
1965bd8deadSopenharmony_ci    Framebuffer), immediately before the subsection "Effects of Attaching a
1975bd8deadSopenharmony_ci    Texture Image":
1985bd8deadSopenharmony_ci
1995bd8deadSopenharmony_ci    "Multiple layers of a two-dimensional array texture can be
2005bd8deadSopenharmony_ci    attached as one of the logical buffers of a framebuffer object with the
2015bd8deadSopenharmony_ci    commands
2025bd8deadSopenharmony_ci
2035bd8deadSopenharmony_ci        void FramebufferTextureMultiviewOVR( enum target, enum attachment,
2045bd8deadSopenharmony_ci                                             uint texture, int level,
2055bd8deadSopenharmony_ci                                             int baseViewIndex, sizei numViews );
2065bd8deadSopenharmony_ci
2075bd8deadSopenharmony_ci      [[ If OpenGL 4.5 or ARB_direct_state_access is supported ]]
2085bd8deadSopenharmony_ci
2095bd8deadSopenharmony_ci        void NamedFramebufferTextureMultiviewOVR( uint framebuffer, enum attachment,
2105bd8deadSopenharmony_ci                                                  uint texture, int level,
2115bd8deadSopenharmony_ci                                                  int baseViewIndex, sizei numViews );
2125bd8deadSopenharmony_ci
2135bd8deadSopenharmony_ci    These commands operate similarly to the FramebufferTextureLayer and
2145bd8deadSopenharmony_ci    NamedFramebufferTexture commands, except that <baseViewIndex>
2155bd8deadSopenharmony_ci    and <numViews> select a range of texture array elements that will be
2165bd8deadSopenharmony_ci    targeted when rendering. Such an attachment is considered _multiview_
2175bd8deadSopenharmony_ci    (section 9.2.2.2) and rendering commands issued when such a framebuffer
2185bd8deadSopenharmony_ci    object is bound are termed "multiview rendering". The maximum number
2195bd8deadSopenharmony_ci    of views which can be bound simultaneously is determined by the value
2205bd8deadSopenharmony_ci    of MAX_VIEWS_OVR, which can be queried with the GetIntegerv command.
2215bd8deadSopenharmony_ci
2225bd8deadSopenharmony_ci    The command
2235bd8deadSopenharmony_ci
2245bd8deadSopenharmony_ci        View( uint id );
2255bd8deadSopenharmony_ci
2265bd8deadSopenharmony_ci    does not exist in the GL, but is used here to describe the multiview
2275bd8deadSopenharmony_ci    functionality in this section.  The effect of this hypothetical function
2285bd8deadSopenharmony_ci    is to set the value of the shader built-in input gl_ViewID_OVR.
2295bd8deadSopenharmony_ci
2305bd8deadSopenharmony_ci    When multiview rendering is enabled, the Clear (section 15.2.3),
2315bd8deadSopenharmony_ci    ClearBuffer* (section 15.2.3.1), and Draw* (section 10.5)
2325bd8deadSopenharmony_ci    commands have the same effect as:
2335bd8deadSopenharmony_ci
2345bd8deadSopenharmony_ci        for( int i = 0; i < numViews; i++ ) {
2355bd8deadSopenharmony_ci            for ( enum attachment : all attachment values where multiple texture array elements have been targeted for rendering ) {
2365bd8deadSopenharmony_ci                FramebufferTextureLayer( target, attachment, texture, level, baseViewIndex + i );
2375bd8deadSopenharmony_ci            }
2385bd8deadSopenharmony_ci            View( i );
2395bd8deadSopenharmony_ci            <command>
2405bd8deadSopenharmony_ci        }
2415bd8deadSopenharmony_ci
2425bd8deadSopenharmony_ci    The result is that every such command is broadcast into every active
2435bd8deadSopenharmony_ci    view. The shader uses gl_ViewID_OVR to compute view dependent outputs.
2445bd8deadSopenharmony_ci
2455bd8deadSopenharmony_ci    The number of views, as specified by <numViews>, must be the same for all
2465bd8deadSopenharmony_ci    framebuffer attachments points where the value of FRAMEBUFFER_ATTACHMENT_-
2475bd8deadSopenharmony_ci    OBJECT_TYPE is not NONE or the framebuffer is incomplete (section 9.4.2).
2485bd8deadSopenharmony_ci
2495bd8deadSopenharmony_ci    If <texture> is non-zero and the command does not result in an error, the
2505bd8deadSopenharmony_ci    framebuffer attachment state corresponding to <attachment> is updated as
2515bd8deadSopenharmony_ci    in the FramebufferTextureLayer command, except that the values of
2525bd8deadSopenharmony_ci    FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER and
2535bd8deadSopenharmony_ci    FRAMEBUFFER_ATTACHMENT_TEXTURE_BASE_VIEW_INDEX_OVR are is set to
2545bd8deadSopenharmony_ci    <baseViewIndex>, and the value of
2555bd8deadSopenharmony_ci    FRAMEBUFFER_ATTACHMENT_TEXTURE_NUM_VIEWS_OVR is set to <numViews>.
2565bd8deadSopenharmony_ci
2575bd8deadSopenharmony_ci    Errors
2585bd8deadSopenharmony_ci
2595bd8deadSopenharmony_ci    In addition to the corresponding errors for FramebufferTextureLayer when
2605bd8deadSopenharmony_ci    called with the same parameters (other than <layer>):
2615bd8deadSopenharmony_ci
2625bd8deadSopenharmony_ci    An INVALID_VALUE error is generated if:
2635bd8deadSopenharmony_ci    - <numViews> is less than 1 or if <numViews> is greater than MAX_VIEWS_OVR.
2645bd8deadSopenharmony_ci    - <texture> is a two-dimensional array texture and <baseViewIndex> +
2655bd8deadSopenharmony_ci      <numViews> is larger than the value of MAX_ARRAY_TEXTURE_LAYERS.
2665bd8deadSopenharmony_ci    - texture is non-zero and <baseViewIndex> is negative."
2675bd8deadSopenharmony_ci
2685bd8deadSopenharmony_ci    An INVALID_OPERATION error is generated if texture is non-zero and is not
2695bd8deadSopenharmony_ci    the name of a two-dimensional array texture."
2705bd8deadSopenharmony_ci
2715bd8deadSopenharmony_ci    Add the following to the list of conditions required for framebuffer
2725bd8deadSopenharmony_ci    attachment completeness in section 9.4.1 (Framebuffer Attachment
2735bd8deadSopenharmony_ci    Completeness):
2745bd8deadSopenharmony_ci
2755bd8deadSopenharmony_ci    "If <image> is a two-dimensional array and the attachment
2765bd8deadSopenharmony_ci    is multiview, all the selected layers, [<baseViewIndex>,
2775bd8deadSopenharmony_ci    <baseViewIndex> + <numViews>), are less than the layer count of the
2785bd8deadSopenharmony_ci    texture."
2795bd8deadSopenharmony_ci
2805bd8deadSopenharmony_ci    Add the following to the list of conditions required for framebuffer
2815bd8deadSopenharmony_ci    completeness in section 9.4.2 (Whole Framebuffer Completeness):
2825bd8deadSopenharmony_ci
2835bd8deadSopenharmony_ci    "The number of views is the same for all populated attachments.
2845bd8deadSopenharmony_ci
2855bd8deadSopenharmony_ci    { FRAMEBUFFER_INCOMPLETE_VIEW_TARGETS_OVR }"
2865bd8deadSopenharmony_ci
2875bd8deadSopenharmony_ciModifications to Chapter 11 of the OpenGL ES 3.2 Specification (Programmable
2885bd8deadSopenharmony_ciVertex Processing
2895bd8deadSopenharmony_ci
2905bd8deadSopenharmony_ci    Modify section 11.1.3.11 (Validation) adding the following conditions
2915bd8deadSopenharmony_ci    to the list of reasons that may result in an INVALID_OPERATION error
2925bd8deadSopenharmony_ci    being generated by any command that transfers vertices to the the GL:
2935bd8deadSopenharmony_ci
2945bd8deadSopenharmony_ci    * Any attachment of the draw framebuffer is multiview (section 9.2.8)
2955bd8deadSopenharmony_ci      and any of the following conditions are true:
2965bd8deadSopenharmony_ci
2975bd8deadSopenharmony_ci      - There is an active program for tessellation control, tessellation
2985bd8deadSopenharmony_ci      evaluation, or geometry stages, or
2995bd8deadSopenharmony_ci
3005bd8deadSopenharmony_ci      - Transform feedback is active and not paused."
3015bd8deadSopenharmony_ci
3025bd8deadSopenharmony_ciModifications to Chapter 15 of the OpenGL ES 3.2 Specification (Writing
3035bd8deadSopenharmony_ciFragments and Samples to the Framebuffer) [OpenGL 4.6 Chapter 17]
3045bd8deadSopenharmony_ci
3055bd8deadSopenharmony_ci    Modify section 15.1.4 [OpenGL 4.6 section 17.3.5] (Occlusion Queries)
3065bd8deadSopenharmony_ci    adding the following to the end of the second paragraph (describing
3075bd8deadSopenharmony_ci    the SAMPLES_PASSED query):
3085bd8deadSopenharmony_ci
3095bd8deadSopenharmony_ci    "During multiview rendering (section 9.2.8), the samples-passed count
3105bd8deadSopenharmony_ci    requirement is relaxed and the samples counted must be between the
3115bd8deadSopenharmony_ci    maximum number of samples counted from any view, and the sum of samples
3125bd8deadSopenharmony_ci    counted for all views."
3135bd8deadSopenharmony_ci
3145bd8deadSopenharmony_ci    Add the following to the end of the fourth paragraph (describing
3155bd8deadSopenharmony_ci    ANY_SAMPLES_PASSED and ANY_SAMPLES_PASSED_CONSERVATIVE):
3165bd8deadSopenharmony_ci
3175bd8deadSopenharmony_ci    "During multiview rendering (section 9.2.8), the samples-boolean state
3185bd8deadSopenharmony_ci    is set to TRUE if the samples-boolean state from any view is set to
3195bd8deadSopenharmony_ci    TRUE."
3205bd8deadSopenharmony_ci
3215bd8deadSopenharmony_ciModifications to Chapter 16 of the OpenGL ES 3.2 Specification (Reading and
3225bd8deadSopenharmony_ciCopying Pixels)
3235bd8deadSopenharmony_ci
3245bd8deadSopenharmony_ci    Add the following paragraph to the end of the description of
3255bd8deadSopenharmony_ci    BlitFramebuffer in section 16.2.1 (Blitting Pixel Rectangles):
3265bd8deadSopenharmony_ci
3275bd8deadSopenharmony_ci    "If the draw framebuffer has multiple views (see section 9.2.8,
3285bd8deadSopenharmony_ci    FramebufferTextureMultiviewOVR), values taken from the read buffer are
3295bd8deadSopenharmony_ci    only written to draw buffers in the first view of the draw framebuffer."
3305bd8deadSopenharmony_ci
3315bd8deadSopenharmony_ci
3325bd8deadSopenharmony_ciNew Implementation Dependent State
3335bd8deadSopenharmony_ci
3345bd8deadSopenharmony_ci    (Additions to Table 21.40 "Implementation Dependent Values")
3355bd8deadSopenharmony_ci
3365bd8deadSopenharmony_ci    Get Value      Type  Get Command  Minimum Value  Description              Sec.
3375bd8deadSopenharmony_ci    ---------      ----  -----------  -------------  -----------              ----
3385bd8deadSopenharmony_ci    MAX_VIEWS_OVR   Z+   GetIntegerv  2              Maximum number of views  9.2.8
3395bd8deadSopenharmony_ci
3405bd8deadSopenharmony_ciModifications to The OpenGL ES Shading Language Specification, Version 3.00.04
3415bd8deadSopenharmony_ci
3425bd8deadSopenharmony_ci    Including the following line in a shader can be used to control the
3435bd8deadSopenharmony_ci    language features described in this extension:
3445bd8deadSopenharmony_ci
3455bd8deadSopenharmony_ci      #extension GL_OVR_multiview : <behavior>
3465bd8deadSopenharmony_ci
3475bd8deadSopenharmony_ci    where <behavior> is as specified in section 3.5.
3485bd8deadSopenharmony_ci
3495bd8deadSopenharmony_ci    A new preprocessor #define is added to the OpenGL ES Shading Language:
3505bd8deadSopenharmony_ci
3515bd8deadSopenharmony_ci      #define GL_OVR_multiview 1
3525bd8deadSopenharmony_ci
3535bd8deadSopenharmony_ci
3545bd8deadSopenharmony_ci    In section 4.3.8.1 "Input Layout Qualifiers":
3555bd8deadSopenharmony_ci
3565bd8deadSopenharmony_ci    Insert a paragraph before the final one ("Fragment shaders cannot ..."):
3575bd8deadSopenharmony_ci
3585bd8deadSopenharmony_ci    Vertex shaders also allow the following layout qualifier on "in" only
3595bd8deadSopenharmony_ci    (not with variable declarations)
3605bd8deadSopenharmony_ci
3615bd8deadSopenharmony_ci    [[ If implemented in OpenGL ES]]
3625bd8deadSopenharmony_ci
3635bd8deadSopenharmony_ci          layout-qualifier-id
3645bd8deadSopenharmony_ci                num_views = integer-constant
3655bd8deadSopenharmony_ci
3665bd8deadSopenharmony_ci    [[ If implemented in OpenGL ]]
3675bd8deadSopenharmony_ci
3685bd8deadSopenharmony_ci          layout-qualifier-id
3695bd8deadSopenharmony_ci                num_views = integer-constant-expression
3705bd8deadSopenharmony_ci
3715bd8deadSopenharmony_ci    to indicate that the shader will only be used with the given number of
3725bd8deadSopenharmony_ci    views, as described in section 4.4 ("Framebuffer Objects") of the OpenGL ES
3735bd8deadSopenharmony_ci    Specification.  If this qualifier is not declared, the behavior is as if it
3745bd8deadSopenharmony_ci    had been set to 1.
3755bd8deadSopenharmony_ci
3765bd8deadSopenharmony_ci    If this layout qualifier is declared more than once in the same shader,
3775bd8deadSopenharmony_ci    all those declarations must set num_views to the same value; otherwise a
3785bd8deadSopenharmony_ci    compile-time error results. If multiple vertex shaders attached to a
3795bd8deadSopenharmony_ci    single program object declare num_views, the declarations must be
3805bd8deadSopenharmony_ci    identical; otherwise a link-time error results. It is a compile-time
3815bd8deadSopenharmony_ci    error to declare num_views to be less than or equal to zero, or greater
3825bd8deadSopenharmony_ci    than MAX_VIEWS_OVR.
3835bd8deadSopenharmony_ci
3845bd8deadSopenharmony_ci    Additions to Section 7.1 "Built-in Language Variables"
3855bd8deadSopenharmony_ci
3865bd8deadSopenharmony_ci    Add the following to the list of built-in variables that are intrinsically
3875bd8deadSopenharmony_ci    declared in the vertex and fragment shading languages:
3885bd8deadSopenharmony_ci
3895bd8deadSopenharmony_ci       in mediump uint gl_ViewID_OVR;
3905bd8deadSopenharmony_ci
3915bd8deadSopenharmony_ci    The gl_ViewID_OVR built-in variable holds the integer index of the view
3925bd8deadSopenharmony_ci    number to which the current shader invocation belongs, as defined in
3935bd8deadSopenharmony_ci    in section 4.4.2.4 (FramebufferTextureMultiviewOVR) in the OpenGL
3945bd8deadSopenharmony_ci    Graphics Systems Specification.
3955bd8deadSopenharmony_ci
3965bd8deadSopenharmony_ci    [[ If OVR_multiview2 is not supported ]]
3975bd8deadSopenharmony_ci
3985bd8deadSopenharmony_ci    It is a compile- or link-time error if any output variable other
3995bd8deadSopenharmony_ci    than gl_Position is statically dependent on gl_ViewID_OVR. If an
4005bd8deadSopenharmony_ci    output variable other than gl_Position is dynamically dependent on
4015bd8deadSopenharmony_ci    gl_ViewID_OVR, the values are undefined.
4025bd8deadSopenharmony_ci
4035bd8deadSopenharmony_ci    NOTE: Implementations that also support OVR_multiview2 may not
4045bd8deadSopenharmony_ci    generate an error if these conditions are violated, even if the
4055bd8deadSopenharmony_ci    OVR_multiview2 extension is not enabled.
4065bd8deadSopenharmony_ci
4075bd8deadSopenharmony_ciErrors
4085bd8deadSopenharmony_ci
4095bd8deadSopenharmony_ci    INVALID_FRAMEBUFFER_OPERATION is generated by commands that read from the
4105bd8deadSopenharmony_ci    framebuffer such as BlitFramebuffer, ReadPixels, CopyTexImage*, and
4115bd8deadSopenharmony_ci    CopyTexSubImage*, if the number of views in the current read framebuffer
4125bd8deadSopenharmony_ci    is greater than 1.
4135bd8deadSopenharmony_ci
4145bd8deadSopenharmony_ci    INVALID_OPERATION is generated if a rendering command is issued and the the
4155bd8deadSopenharmony_ci    number of views in the current draw framebuffer is not equal to the number
4165bd8deadSopenharmony_ci    of views declared in the currently bound program.
4175bd8deadSopenharmony_ci
4185bd8deadSopenharmony_ciInteractions with OpenGL 3.3, ARB_timer_query, and EXT_disjoint_timer_query
4195bd8deadSopenharmony_ci
4205bd8deadSopenharmony_ci    If none of OpenGL 3.3, ARB_timer_query, or EXT_disjoint_timer_query
4215bd8deadSopenharmony_ci    are supported, ignore references to TIMESTAMP and TIME_ELAPSED queries.
4225bd8deadSopenharmony_ci
4235bd8deadSopenharmony_ciInteractions with OpenGL 4.5, ARB_direct_state_access, and
4245bd8deadSopenharmony_ciEXT_direct_state_access
4255bd8deadSopenharmony_ci
4265bd8deadSopenharmony_ci    If none of OpenGL 4.5, ARB_direct_state_access and EXT_direct_state_access
4275bd8deadSopenharmony_ci    are supported, the command NamedFramebufferTextureMultiviewOVR does not
4285bd8deadSopenharmony_ci    exist.
4295bd8deadSopenharmony_ci
4305bd8deadSopenharmony_ciInteractions with OpenGL ES 3.2, OpenGL 4.0, EXT_tessellation_shader,
4315bd8deadSopenharmony_ciOES_tessellation_shader and ARB_tessellation_shader.
4325bd8deadSopenharmony_ci
4335bd8deadSopenharmony_ci    If none of OpenGL ES 3.2, OpenGL 4.0, EXT_tessellation_shader,
4345bd8deadSopenharmony_ci    OES_tessellation_shader or ARB_tessellation shader are supported, ignore
4355bd8deadSopenharmony_ci    all references to tessellation shaders.
4365bd8deadSopenharmony_ci
4375bd8deadSopenharmony_ciInteractions with OpenGL ES 3.2, OpenGL 3.2, EXT_geometry_shader,
4385bd8deadSopenharmony_ciOES_geometry_shader, and ARB_geometry_shader4.
4395bd8deadSopenharmony_ci
4405bd8deadSopenharmony_ci    If none of OpenGL ES 3.2, OpenGL 3.2, EXT_geometry_shader,
4415bd8deadSopenharmony_ci    OES_geometry_shader, or ARB_geometry_shader4 are supported, ignore all
4425bd8deadSopenharmony_ci    references to geometry shaders.
4435bd8deadSopenharmony_ci
4445bd8deadSopenharmony_ciInteractions with OpenGL 4.3, ARB_multi_draw_indirect, and
4455bd8deadSopenharmony_ciEXT_multi_draw_indirect.
4465bd8deadSopenharmony_ci
4475bd8deadSopenharmony_ci    If none of OpenGL 4.3, ARB_multi_draw_indirect, or EXT_multi_draw_indirect
4485bd8deadSopenharmony_ci    are supported, ignore all references to multi-draw-indirect.
4495bd8deadSopenharmony_ci
4505bd8deadSopenharmony_ciInteractions with OpenGL 3.0
4515bd8deadSopenharmony_ci
4525bd8deadSopenharmony_ci    If OpenGL 3.0 (or later) is not supported, ignore all references to the
4535bd8deadSopenharmony_ci    SAMPLES_PASSED occlusion query target.
4545bd8deadSopenharmony_ci
4555bd8deadSopenharmony_ciInteractions with OpenGL ES 3.2, OpenGL 4.3, EXT_geometry_shader,
4565bd8deadSopenharmony_ciOES_geometry_shader, and ARB_fragment_layer_viewport
4575bd8deadSopenharmony_ci
4585bd8deadSopenharmony_ci    If none of OpenGL ES 3.2, OpenGL 4.3, EXT_geometry_shader,
4595bd8deadSopenharmony_ci    OES_geometry_shader, or ARB_fragment_layer_viewport is supported, ignore
4605bd8deadSopenharmony_ci    all references to gl_Layer.
4615bd8deadSopenharmony_ci
4625bd8deadSopenharmony_ciInteractions with OpenGL 3.0 Compatibility Profile
4635bd8deadSopenharmony_ci
4645bd8deadSopenharmony_ci    If OpenGL 3.0 Compatibility Profile (or later) is not supported, ignore all
4655bd8deadSopenharmony_ci    references to Begin/End.
4665bd8deadSopenharmony_ci
4675bd8deadSopenharmony_ci
4685bd8deadSopenharmony_ciIssues
4695bd8deadSopenharmony_ci
4705bd8deadSopenharmony_ci    (1) Should geometry shaders be allowed in multiview mode?
4715bd8deadSopenharmony_ci
4725bd8deadSopenharmony_ci    Resolved: Not in this extension. By disallowing it, we hope to enable more
4735bd8deadSopenharmony_ci    implementations to be available sooner, and there are complex issues that
4745bd8deadSopenharmony_ci    arise when a GS is used to target gl_Layer explicitly.
4755bd8deadSopenharmony_ci
4765bd8deadSopenharmony_ci    (2) Should there be separate scissor and viewport per view?
4775bd8deadSopenharmony_ci
4785bd8deadSopenharmony_ci    Resolved: No, while there might be some uses for such support, it adds
4795bd8deadSopenharmony_ci    unnecessary implementation complexity. In the case of inset rendering, there
4805bd8deadSopenharmony_ci    will be a need to adjust the scissor per view.  We will defer that issue for
4815bd8deadSopenharmony_ci    now by forcing all views to use the same scissor and viewport.
4825bd8deadSopenharmony_ci
4835bd8deadSopenharmony_ci    (3) Why not just use geometry shaders?
4845bd8deadSopenharmony_ci
4855bd8deadSopenharmony_ci    Resolved: GS could be used to achieve stereo rendering by broadcasting each
4865bd8deadSopenharmony_ci    primitive to each view.  The problem with this approach is that it requires
4875bd8deadSopenharmony_ci    the GS's very general mechanism with known performance implications to solve
4885bd8deadSopenharmony_ci    a problem that does not require that solution and perhaps more frequently
4895bd8deadSopenharmony_ci    than not, will not be the most efficient means of implementation.
4905bd8deadSopenharmony_ci
4915bd8deadSopenharmony_ci    (4) Why use texture arrays instead of separate FBOs?
4925bd8deadSopenharmony_ci
4935bd8deadSopenharmony_ci    Resolved: Use of arrays does imply that we use a minimum version of GL and
4945bd8deadSopenharmony_ci    ES 3.0. On the other hand, it has some nice simplifying properties.  In
4955bd8deadSopenharmony_ci    particular, the format and resolution of each view is known to be the same
4965bd8deadSopenharmony_ci    and only one FBO is bound, just like with normal rendering.  It has some
4975bd8deadSopenharmony_ci    potentially limiting interactions with GS use, but on the whole, the
4985bd8deadSopenharmony_ci    implementation simplifications are considered worth the implied limitations.
4995bd8deadSopenharmony_ci
5005bd8deadSopenharmony_ci    (5) How does this extension interact with occlusion queries, timer queries,
5015bd8deadSopenharmony_ci    etc?
5025bd8deadSopenharmony_ci
5035bd8deadSopenharmony_ci    Resolved: The bias will be toward relaxed rules to allow implementation
5045bd8deadSopenharmony_ci    freedom. For example, occlusion queries should not return fewer than the max
5055bd8deadSopenharmony_ci    samples returned from any view, but returning the sum may also be fine.
5065bd8deadSopenharmony_ci    Simply reporting the result from view 0 is not sufficient.
5075bd8deadSopenharmony_ci
5085bd8deadSopenharmony_ci    (6) Is gl_ViewID_OVR visible at every pipeline stage?
5095bd8deadSopenharmony_ci
5105bd8deadSopenharmony_ci    Resolved: To make integration simple for app developers, the intent is for
5115bd8deadSopenharmony_ci    gl_ViewID_OVR to be visible as a built-in at each programmable pipeline stage.
5125bd8deadSopenharmony_ci
5135bd8deadSopenharmony_ci    (7) Are view-dependent parameters exposed explicitly?
5145bd8deadSopenharmony_ci
5155bd8deadSopenharmony_ci    Resolved: No.  This is implicit in the dependence of a parameter on ViewID.
5165bd8deadSopenharmony_ci    In this extension, however, only gl_Position is allowed to depend on ViewID
5175bd8deadSopenharmony_ci    in the vertex shader. If a shader violates this restriction it results in
5185bd8deadSopenharmony_ci    undefined behavior or may produce an error.  Later extensions may relax that
5195bd8deadSopenharmony_ci    restriction.
5205bd8deadSopenharmony_ci
5215bd8deadSopenharmony_ci    (8) Should the parameters that affect view-dependent position be driver
5225bd8deadSopenharmony_ci    visible or otherwise restricted?
5235bd8deadSopenharmony_ci
5245bd8deadSopenharmony_ci    Resolved: No. Letting the app index via ViewID makes it a lot harder for the
5255bd8deadSopenharmony_ci    driver to know much about the details of the transform inputs that result in
5265bd8deadSopenharmony_ci    view-dependent outputs, but no such support exists in the API today either.
5275bd8deadSopenharmony_ci    Adding that support would be complex, and thus not in the spirit of an
5285bd8deadSopenharmony_ci    extension that can be implemented broadly with low risk.
5295bd8deadSopenharmony_ci
5305bd8deadSopenharmony_ci    (9) Should there be a per-view UBO instead of exposing gl_ViewID_OVR in the shader?
5315bd8deadSopenharmony_ci
5325bd8deadSopenharmony_ci    Resolved: No. Exposing the gl_ViewID_OVR variable is the smallest change. It
5335bd8deadSopenharmony_ci    does imply dynamic branching, predication, or indexing based on the view id,
5345bd8deadSopenharmony_ci    however, implementations could compile separate versions of the shader with
5355bd8deadSopenharmony_ci    view id translated to literals if that would improve performance.  Extra API
5365bd8deadSopenharmony_ci    and machinery would be required to sequence one or more UBOs to different
5375bd8deadSopenharmony_ci    objects per view.
5385bd8deadSopenharmony_ci
5395bd8deadSopenharmony_ci    (10) Should there be DSA style entry points?
5405bd8deadSopenharmony_ci
5415bd8deadSopenharmony_ci    Resolved: Almost certainly in GL 4.5 and beyond.  Less clear that it should
5425bd8deadSopenharmony_ci    be required for ES 3.0.
5435bd8deadSopenharmony_ci
5445bd8deadSopenharmony_ci    (11) Should tessellation shaders be allowed in multiview mode?
5455bd8deadSopenharmony_ci
5465bd8deadSopenharmony_ci    Resolved: Not in this extension. By disallowing it, we hope to enable more
5475bd8deadSopenharmony_ci    implementations to be available sooner.
5485bd8deadSopenharmony_ci
5495bd8deadSopenharmony_ci    (12) Does the number of views need to be declared in the shader?
5505bd8deadSopenharmony_ci
5515bd8deadSopenharmony_ci    Resolved: Yes. This enables the implementation to specialize the compilation
5525bd8deadSopenharmony_ci    for the declared number of views, for example by loop-unrolling. It could
5535bd8deadSopenharmony_ci    also serves as a notification that the shader outputs must be 'broadcast' to
5545bd8deadSopenharmony_ci    a set of views - even in cases where the shader does not reference from
5555bd8deadSopenharmony_ci    gl_ViewID_OVR.
5565bd8deadSopenharmony_ci
5575bd8deadSopenharmony_ci    (13) What should happen if the number of views declared in the shader does
5585bd8deadSopenharmony_ci    not match num_views?
5595bd8deadSopenharmony_ci
5605bd8deadSopenharmony_ci    Resolved: Such a mismatch can only be detected at draw call time, so it
5615bd8deadSopenharmony_ci    would have to either generate a draw call time error, or just result in
5625bd8deadSopenharmony_ci    undefined results for any view > num_views. To avoid undefined results, the
5635bd8deadSopenharmony_ci    draw call time error is preferred.
5645bd8deadSopenharmony_ci
5655bd8deadSopenharmony_ci    (14) How should read operations on FBOs with multiview texture attachments be
5665bd8deadSopenharmony_ci    handled?
5675bd8deadSopenharmony_ci
5685bd8deadSopenharmony_ci    Resolved: Generating INVALID_OPERATION when the target is GL_READ_FRAMEBUFFER
5695bd8deadSopenharmony_ci    for FramebufferTextureMultiviewOVR to disallow attaching a multiview texture
5705bd8deadSopenharmony_ci    to the current read framebuffer is not sufficient to prevent a read operation
5715bd8deadSopenharmony_ci    on a FBO with a multiview texture attachment. The multiview texture may still
5725bd8deadSopenharmony_ci    be attached to the current write framebuffer and then bound as the read
5735bd8deadSopenharmony_ci    framebuffer. Instead, an INVALID_FRAMEBUFFER_OPERATION error should be
5745bd8deadSopenharmony_ci    generated for any read operations that occur whenever a multiview texture is
5755bd8deadSopenharmony_ci    attached to the current read framebuffer. The multiview texture needs to be
5765bd8deadSopenharmony_ci    instead attached as a 2D texture array with the level explicitly specified to
5775bd8deadSopenharmony_ci    be read. This conforms to the expected behavior for read operations on FBOs
5785bd8deadSopenharmony_ci    with multiview texture attachments to be consistent with
5795bd8deadSopenharmony_ci    FramebufferTextureMultisampleMultiviewOVR.
5805bd8deadSopenharmony_ci    
5815bd8deadSopenharmony_ci    (15) How do clears apply to framebuffers with multiple views
5825bd8deadSopenharmony_ci    (bugzilla 16173)?
5835bd8deadSopenharmony_ci    
5845bd8deadSopenharmony_ci    Resolved: Clears are applied to all views.
5855bd8deadSopenharmony_ci    
5865bd8deadSopenharmony_ci    (16) How should blit operations to draw framebuffers with multiple views
5875bd8deadSopenharmony_ci    be handled (bugzilla 16174)?
5885bd8deadSopenharmony_ci    
5895bd8deadSopenharmony_ci    Resolved: The options are to broadcast the blit, only blit to a subset
5905bd8deadSopenharmony_ci    of views, or throw an error. There's no particularly compelling use case
5915bd8deadSopenharmony_ci    for either of the first options, so an error would have been desirable.
5925bd8deadSopenharmony_ci    However, this was missed when the extension was initially drafted, and
5935bd8deadSopenharmony_ci    implementations all ended up doing the same thing - blitting to just the
5945bd8deadSopenharmony_ci    first view of the draw framebuffer.
5955bd8deadSopenharmony_ci    
5965bd8deadSopenharmony_ci    (17) How do clears apply to framebuffers with multiple views
5975bd8deadSopenharmony_ci    (bugzilla 16173)?
5985bd8deadSopenharmony_ci    
5995bd8deadSopenharmony_ci    Resolved: Clears are applied to all views.
6005bd8deadSopenharmony_ci
6015bd8deadSopenharmony_ci    (18) What happens if the num_views layout qualifier has an invalid value
6025bd8deadSopenharmony_ci    like zero or something above MAX_VIEWS_OVR?  What happens if num_views
6035bd8deadSopenharmony_ci    is specified multiple times in the same shader, or in multiple vertex
6045bd8deadSopenharmony_ci    shaders (this is only possible in OpenGL)?
6055bd8deadSopenharmony_ci
6065bd8deadSopenharmony_ci    RESOLVED: This is treated similarly to how layout local_size_{x,y,z} is
6075bd8deadSopenharmony_ci    handled in compute shaders:
6085bd8deadSopenharmony_ci    - num_views <= 0 or > MAX_VIEWS_OVR is a compile error
6095bd8deadSopenharmony_ci    - if declared multiple times in the same shader the values
6105bd8deadSopenharmony_ci      must be the same or a compile-time error results.
6115bd8deadSopenharmony_ci    - if declared in multiple shaders attached to the same program object
6125bd8deadSopenharmony_ci      a link-time error results.
6135bd8deadSopenharmony_ci
6145bd8deadSopenharmony_ci    (19) Is the shader built-in variable really called gl_ViewID_OVR? The
6155bd8deadSopenharmony_ci    shading language convention does not normally include an underscore before
6165bd8deadSopenharmony_ci    the vendor suffix.
6175bd8deadSopenharmony_ci
6185bd8deadSopenharmony_ci    RESOLVED: Yes it really is. It doesn't quite follow the standard extension
6195bd8deadSopenharmony_ci    conventions, but there were a number of implementations that already
6205bd8deadSopenharmony_ci    supported it before this was realized. We'll just leave it this way for
6215bd8deadSopenharmony_ci    compatibility.
6225bd8deadSopenharmony_ci
6235bd8deadSopenharmony_ci    (20) Is there a gl_MaxViewsOVR shading language built-in constant?
6245bd8deadSopenharmony_ci
6255bd8deadSopenharmony_ci    RESOLVED: No. Initial implementations didn't provide this. If this ever
6265bd8deadSopenharmony_ci    is made KHR or core functionality, this could be added.
6275bd8deadSopenharmony_ci
6285bd8deadSopenharmony_ci    (21) What is the minimum values permitted for MAX_VIEWS_OVR?
6295bd8deadSopenharmony_ci
6305bd8deadSopenharmony_ci    RESOLVED: 2. But at least 6 is recommended for consistency with Vulkan.
6315bd8deadSopenharmony_ci    Six views is desireable as it can be used to render all faces of a cube map
6325bd8deadSopenharmony_ci    in a single pass. Added state table entries for this in revision 0.8.
6335bd8deadSopenharmony_ci
6345bd8deadSopenharmony_ci    (22) What are the rules to check if anything other than gl_Position
6355bd8deadSopenharmony_ci    depends on gl_ViewID_OVR and what happens if the rules aren't met?
6365bd8deadSopenharmony_ci
6375bd8deadSopenharmony_ci    RESOLVED: It is a compile- or link-time error if it can be determined
6385bd8deadSopenharmony_ci    that an output variable other than gl_Position is statically dependent on
6395bd8deadSopenharmony_ci    gl_ViewID_OVR. However, if an output variable other than gl_Position
6405bd8deadSopenharmony_ci    is dynamically dependent on gl_ViewID_OVR, the results are undefined.
6415bd8deadSopenharmony_ci
6425bd8deadSopenharmony_ci    NOTE: This restriction is relaxed if OVR_multiview2 is supported,
6435bd8deadSopenharmony_ci    and some implementations may not implement these checks even if
6445bd8deadSopenharmony_ci    OVR_multiview2 is not enabled. It is recommended and preferred that
6455bd8deadSopenharmony_ci    all implemenations support OVR_multiview2 and that applications
6465bd8deadSopenharmony_ci    enable the extension when present.
6475bd8deadSopenharmony_ci
6485bd8deadSopenharmony_ci    For non-VTG stages (eg fragment) which don't have a gl_Position output
6495bd8deadSopenharmony_ci    variable this means that no outputs can depend on the gl_VIewID_OVR.
6505bd8deadSopenharmony_ci    It is still possible that shader side effects (such as image or buffer
6515bd8deadSopenharmony_ci    stores, if supported) could be view-dependent.
6525bd8deadSopenharmony_ci
6535bd8deadSopenharmony_ci    (23) What is the behaviour if transform feedback, tessellation or
6545bd8deadSopenharmony_ci    geometry shaders, or timer queries are used?
6555bd8deadSopenharmony_ci
6565bd8deadSopenharmony_ci    RESOLVED: INVALID_OPERATION is generated for any draw operation
6575bd8deadSopenharmony_ci    with when the draw framebuffer is multiview if there is an active
6585bd8deadSopenharmony_ci    tessellation control, tessellation evaluation, or geometery shader,
6595bd8deadSopenharmony_ci    or if transform feedback is active.
6605bd8deadSopenharmony_ci
6615bd8deadSopenharmony_ci    For timer queries there is no good time to do a multiview error check,
6625bd8deadSopenharmony_ci    (because a multiview framebuffer could be bound before or after the
6635bd8deadSopenharmony_ci    timer query has started) and thus the results of the TIME_ELAPSED
6645bd8deadSopenharmony_ci    and TIMESTAMP queries have undefined values if a multiview framebuffer
6655bd8deadSopenharmony_ci    was bound at any time during their execution.
6665bd8deadSopenharmony_ci
6675bd8deadSopenharmony_ci    (24) Do instanced drawing commands (DrawArraysInstanced*, and
6685bd8deadSopenharmony_ci    DrawElementsInstanced*) work with this extension?
6695bd8deadSopenharmony_ci
6705bd8deadSopenharmony_ci    RESOLVED: Yes. No specific edits are required because "It Just Works"(TM)
6715bd8deadSopenharmony_ci
6725bd8deadSopenharmony_ci    (25) Do indirect drawing commands (DrawArraysIndirect, DrawElementsIndirect),
6735bd8deadSopenharmony_ci    work with this extension?
6745bd8deadSopenharmony_ci
6755bd8deadSopenharmony_ci    RESOLVED: Yes. No specific edits are required because "It Just Works"(TM)
6765bd8deadSopenharmony_ci
6775bd8deadSopenharmony_ci    (26) Do multi draw indirect commands (MultiDrawArraysIndirect,
6785bd8deadSopenharmony_ci    MultiDrawElementsIndirect) work with this extension?
6795bd8deadSopenharmony_ci
6805bd8deadSopenharmony_ci    RESOLVED: Yes. No specific edits are required because "It Just Works"(TM)
6815bd8deadSopenharmony_ci
6825bd8deadSopenharmony_ci    (27) What happens if the <baseViewIndex> + <numViews> is out of range?
6835bd8deadSopenharmony_ci    For example, if it's greater than the number of layers in the attached
6845bd8deadSopenharmony_ci    texture or greater than MAX_ARRAY_TEXTURE_LAYERS?
6855bd8deadSopenharmony_ci
6865bd8deadSopenharmony_ci    RESOLVED: In cases there the resulting value could never be a valid
6875bd8deadSopenharmony_ci    <layer> argument to FramebufferTextureLayer, the INVALID_VALUE value
6885bd8deadSopenharmony_ci    is generated. This follows from the fact that
6895bd8deadSopenharmony_ci    FramebufferTextureMultiviewOVR is defined in terms of
6905bd8deadSopenharmony_ci    FramebufferTextureLayer. For cases which are dependant on the properties
6915bd8deadSopenharmony_ci    of a specific texture (referencing more layers than exist), this is a
6925bd8deadSopenharmony_ci    to be a framebuffer attachment completeness check as this can change if
6935bd8deadSopenharmony_ci    the texture is redefined after the FramebufferTextureMultiviewOVR call.
6945bd8deadSopenharmony_ci
6955bd8deadSopenharmony_ci    (28) What is the value of FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER after
6965bd8deadSopenharmony_ci    FramebufferTextureMultiviewOVR is called?
6975bd8deadSopenharmony_ci
6985bd8deadSopenharmony_ci    RESOLVED: It is set it to the value of <baseViewIndex>.
6995bd8deadSopenharmony_ci    A FRAMEBUFFER_ATTACHMENT_MULTIVIEW_OVR framebuffer property would be
7005bd8deadSopenharmony_ci    useful here..
7015bd8deadSopenharmony_ci
7025bd8deadSopenharmony_ci    (29) Should there be a FRAMEBUFFER_ATTACHMENT_MULTIVIEW_OVR property to
7035bd8deadSopenharmony_ci    indicate multiview framebuffers, similar to the
7045bd8deadSopenharmony_ci    FRAMEBUFFER_ATTACHMENT_LAYERED property?
7055bd8deadSopenharmony_ci
7065bd8deadSopenharmony_ci    RESOLVED: No. Ideally there would to allow distinguising between
7075bd8deadSopenharmony_ci    layered framebuffers and multiview framebuffers, and to know which of
7085bd8deadSopenharmony_ci    FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER,
7095bd8deadSopenharmony_ci    FRAMEBUFFER_ATTACHMENT_TEXTURE_NUM_VIEWS_OVR, and
7105bd8deadSopenharmony_ci    FRAMEBUFFER_ATTACHMENT_TEXTURE_BASE_VIEW_INDEX_OVR are valid.
7115bd8deadSopenharmony_ci    Unfortunately existing implementations don't have this, so it will
7125bd8deadSopenharmony_ci    just have to be implied. This is something that could be improved in
7135bd8deadSopenharmony_ci    a promoted version of this extension.
7145bd8deadSopenharmony_ci
7155bd8deadSopenharmony_ci    (30) What types of textures can be used for multiview rendering?
7165bd8deadSopenharmony_ci    Two-dimensional array textures at a minimum, what about three-
7175bd8deadSopenharmony_ci    dimensional, cube map, cube map array or two-dimensional
7185bd8deadSopenharmony_ci    multisample textures which are also accepted by FramebufferTextureLayer
7195bd8deadSopenharmony_ci    (which is what this extension is defined in terms of).
7205bd8deadSopenharmony_ci
7215bd8deadSopenharmony_ci    RESOLVED. The initial extension is limited to two-dimensional array
7225bd8deadSopenharmony_ci    textures. A future extension could extend it further if there is demand.
7235bd8deadSopenharmony_ci
7245bd8deadSopenharmony_ci    (31) Is multiview supported for compute shaders? If so, how would it work?
7255bd8deadSopenharmony_ci
7265bd8deadSopenharmony_ci    RESOLVED. No. Multiview rendering is orthogonal to compute shaders since
7275bd8deadSopenharmony_ci    Dispatch* commands do not operate on framebuffer attachments and therefore
7285bd8deadSopenharmony_ci    it is meaningless to try to describe interactions with multiview
7295bd8deadSopenharmony_ci    framebuffers. Prior to revision 3, this specification stated that
7305bd8deadSopenharmony_ci    gl_ViewID_OVR was available in the compute shading language but not all
7315bd8deadSopenharmony_ci    implementations did so, and for those that did, it is impossible for it
7325bd8deadSopenharmony_ci    to ever have a value other than 0.
7335bd8deadSopenharmony_ci
7345bd8deadSopenharmony_ci    (32) If geometry and tessellation shaders are not supported with multiview
7355bd8deadSopenharmony_ci    rendering why allow gl_ViewID_OVR to be accepted in tessellation and
7365bd8deadSopenharmony_ci    geometry shaders?
7375bd8deadSopenharmony_ci
7385bd8deadSopenharmony_ci    RESOLVED. There is no benefit. This was removed in revision 3. Older
7395bd8deadSopenharmony_ci    drivers may of course continue to allow such shaders to compile, but
7405bd8deadSopenharmony_ci    it is not possible to use them.
7415bd8deadSopenharmony_ci
7425bd8deadSopenharmony_ci    (33) How does the gl_Layer builtin input in the fragment shader interact
7435bd8deadSopenharmony_ci    with multiview?
7445bd8deadSopenharmony_ci
7455bd8deadSopenharmony_ci    RESOLVED: Whenever a multiview framebuffer is bound, the contents of
7465bd8deadSopenharmony_ci    gl_Layer in the fragment shader are undefined. This is consistent with
7475bd8deadSopenharmony_ci    issue (1), which disallows geometry shader with multiview framebuffers.
7485bd8deadSopenharmony_ci
7495bd8deadSopenharmony_ci    (34) How does this extension interact with the OpenGL Compatibility
7505bd8deadSopenharmony_ci    Profile?
7515bd8deadSopenharmony_ci
7525bd8deadSopenharmony_ci    RESOLVED: When a multiview framebuffer is bound, Begin/End may render to a
7535bd8deadSopenharmony_ci    subset of the views in the framebuffer. (Specifically which views is
7545bd8deadSopenharmony_ci    undefined, and may be any subset of the views attached to the framebuffer,
7555bd8deadSopenharmony_ci    including the null set.)
7565bd8deadSopenharmony_ci
7575bd8deadSopenharmony_ci
7585bd8deadSopenharmony_ciRevision History
7595bd8deadSopenharmony_ci
7605bd8deadSopenharmony_ci      Rev.    Date    Author    Changes
7615bd8deadSopenharmony_ci      ----  --------  --------  -----------------------------------------
7625bd8deadSopenharmony_ci      0.1   10/17/14  cass      Initial draft
7635bd8deadSopenharmony_ci      0.2   11/10/14  cass      Changes to use texture array instead of separate FBOs
7645bd8deadSopenharmony_ci      0.3   02/05/15  cass      Only gl_Position can be view dependent in the vertex shader.
7655bd8deadSopenharmony_ci      0.4   02/11/15  cass      Switch to view instead of layer, as these are distinct now
7665bd8deadSopenharmony_ci      0.5   04/15/15  cass      Clean up pass before publishing
7675bd8deadSopenharmony_ci      0.6   07/01/16  nigelw    Modify errors to conform to multisample multiview spec changes
7685bd8deadSopenharmony_ci      0.7   07/25/17  tjh       Clarify Blit and Clear behaviours, and fixed framebuffer attachment
7695bd8deadSopenharmony_ci                                binding psuedocode (bugzillas 16173, 16174, 16176)
7705bd8deadSopenharmony_ci      1     10/10/17  dgkoch    Completed extension.
7715bd8deadSopenharmony_ci                                - Rebased on ES 3.2 (and OpenGL 4.6 where necessary) and added
7725bd8deadSopenharmony_ci                                  extension interactions
7735bd8deadSopenharmony_ci                                - Added DSA command for GL: NamedFramebufferTextureMultiviewOVR
7745bd8deadSopenharmony_ci                                - properly documented gl_ViewID_OVR and behaviour
7755bd8deadSopenharmony_ci                                - documented error behavior for num_views
7765bd8deadSopenharmony_ci                                - added error behavior for tess, geom, xfb, and timer queries
7775bd8deadSopenharmony_ci                                - documented new FRAMEBUFFER_ATTACHMENT*OVR variables
7785bd8deadSopenharmony_ci                                - clarify that only 2D-array textures are supported
7795bd8deadSopenharmony_ci                                - better document new framebuffer completeness conditions
7805bd8deadSopenharmony_ci                                - document MAX_VIEWS_OVR and specify minimum value (2)
7815bd8deadSopenharmony_ci                                - added issues 18-30
7825bd8deadSopenharmony_ci      2     11/15/17  dgkoch    Fix tessellation typos. Fix incorrect reference to compute shaders
7835bd8deadSopenharmony_ci                                instead of vertex shaders.
7845bd8deadSopenharmony_ci      3     12/13/17  dgkoch    Clarify that compute shaders are orthogonal to multiview
7855bd8deadSopenharmony_ci                                framebuffers (Issue 31). Remove gl_ViewID_OVR from compute,
7865bd8deadSopenharmony_ci                                tessellation, and geometry shaders.
7875bd8deadSopenharmony_ci      4     05/02/18  jhelferty Clarify interop rules for gl_Layer in fragment shader (33), and
7885bd8deadSopenharmony_ci                                interop with compatibility profile's Begin/End (34). Add mention
7895bd8deadSopenharmony_ci                                of OES_geometry_shader and OES_tessellation_shader to interop.
7905bd8deadSopenharmony_ci                                Clarify what happens when transform feedback is paused.
7915bd8deadSopenharmony_ci      5     07/25/18  oetuaho   Fix off-by-one issue in baseViewIndex + numViews check.
7925bd8deadSopenharmony_ci      6     10/19/18  dgkoch    Add standard boiler plate shader extension language.
7935bd8deadSopenharmony_ci
794