Merge pull request #222 from KhronosGroup/dgkoch_ifq2_20

Define tokens for VIEW_CLASS_{EAC*,ETC2*,ASTC*}
diff --git a/api/GL/glext.h b/api/GL/glext.h
index 2b26b6e..1cde373 100644
--- a/api/GL/glext.h
+++ b/api/GL/glext.h
@@ -51,7 +51,7 @@
 #define GLAPI extern
 #endif
 
-#define GL_GLEXT_VERSION 20180919
+#define GL_GLEXT_VERSION 20181017
 
 /* Generated C header for:
  * API: gl
@@ -11296,6 +11296,14 @@
 #endif
 #endif /* GL_NV_vdpau_interop */
 
+#ifndef GL_NV_vdpau_interop2
+#define GL_NV_vdpau_interop2 1
+typedef GLvdpauSurfaceNV (APIENTRYP PFNGLVDPAUREGISTERVIDEOSURFACEWITHPICTURESTRUCTURENVPROC) (const void *vdpSurface, GLenum target, GLsizei numTextureNames, const GLuint *textureNames, GLboolean isFrameStructure);
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI GLvdpauSurfaceNV APIENTRY glVDPAURegisterVideoSurfaceWithPictureStructureNV (const void *vdpSurface, GLenum target, GLsizei numTextureNames, const GLuint *textureNames, GLboolean isFrameStructure);
+#endif
+#endif /* GL_NV_vdpau_interop2 */
+
 #ifndef GL_NV_vertex_array_range
 #define GL_NV_vertex_array_range 1
 #define GL_VERTEX_ARRAY_RANGE_NV          0x851D
diff --git a/api/GL/glxext.h b/api/GL/glxext.h
index eff6aed..12da554 100755
--- a/api/GL/glxext.h
+++ b/api/GL/glxext.h
@@ -34,7 +34,7 @@
 **   https://github.com/KhronosGroup/OpenGL-Registry
 */
 
-#define GLX_GLXEXT_VERSION 20180905
+#define GLX_GLXEXT_VERSION 20181017
 
 /* Generated C header for:
  * API: glx
diff --git a/api/GL/wgl.h b/api/GL/wgl.h
index 7c63d48..8f5c059 100644
--- a/api/GL/wgl.h
+++ b/api/GL/wgl.h
@@ -39,7 +39,7 @@
 #include <windows.h>
 #endif
 
-/* Generated on date 20180927 */
+/* Generated on date 20181017 */
 
 /* Generated C header for:
  * API: wgl
diff --git a/api/GL/wglext.h b/api/GL/wglext.h
index 7c6f9f5..0785c32 100755
--- a/api/GL/wglext.h
+++ b/api/GL/wglext.h
@@ -39,7 +39,7 @@
 #include <windows.h>
 #endif
 
-#define WGL_WGLEXT_VERSION 20180927
+#define WGL_WGLEXT_VERSION 20181017
 
 /* Generated C header for:
  * API: wgl
diff --git a/api/GLES/gl.h b/api/GLES/gl.h
index c311fb6..d80ea4a 100644
--- a/api/GLES/gl.h
+++ b/api/GLES/gl.h
@@ -36,7 +36,7 @@
 
 #include <GLES/glplatform.h>
 
-/* Generated on date 20180919 */
+/* Generated on date 20181017 */
 
 /* Generated C header for:
  * API: gles1
diff --git a/api/GLES/glext.h b/api/GLES/glext.h
index f9b8cf1..da8d199 100644
--- a/api/GLES/glext.h
+++ b/api/GLES/glext.h
@@ -38,7 +38,7 @@
 #define GL_APIENTRYP GL_APIENTRY*
 #endif
 
-/* Generated on date 20180919 */
+/* Generated on date 20181017 */
 
 /* Generated C header for:
  * API: gles1
diff --git a/api/GLES2/gl2.h b/api/GLES2/gl2.h
index 61ff2cf..c539a92 100644
--- a/api/GLES2/gl2.h
+++ b/api/GLES2/gl2.h
@@ -44,7 +44,7 @@
 #define GL_GLES_PROTOTYPES 1
 #endif
 
-/* Generated on date 20180919 */
+/* Generated on date 20181017 */
 
 /* Generated C header for:
  * API: gles2
diff --git a/api/GLES2/gl2ext.h b/api/GLES2/gl2ext.h
index 00ec06d..21770b9 100644
--- a/api/GLES2/gl2ext.h
+++ b/api/GLES2/gl2ext.h
@@ -38,7 +38,7 @@
 #define GL_APIENTRYP GL_APIENTRY*
 #endif
 
-/* Generated on date 20180919 */
+/* Generated on date 20181017 */
 
 /* Generated C header for:
  * API: gles2
diff --git a/api/GLES3/gl3.h b/api/GLES3/gl3.h
index e9e65b9..0fdbe79 100644
--- a/api/GLES3/gl3.h
+++ b/api/GLES3/gl3.h
@@ -44,7 +44,7 @@
 #define GL_GLES_PROTOTYPES 1
 #endif
 
-/* Generated on date 20180919 */
+/* Generated on date 20181017 */
 
 /* Generated C header for:
  * API: gles2
diff --git a/extensions/NV/NV_vdpau_interop2.txt b/extensions/NV/NV_vdpau_interop2.txt
new file mode 100644
index 0000000..45c371c
--- /dev/null
+++ b/extensions/NV/NV_vdpau_interop2.txt
@@ -0,0 +1,206 @@
+Name
+
+    NV_vdpau_interop2
+
+Name Strings
+
+    GL_NV_vdpau_interop2
+
+Contributors
+
+    Manoj Gupta Bonda, NVIDIA
+    James Jones, NVIDIA
+
+Contact
+
+    Manoj Gupta Bonda, NVIDIA (mbonda 'at' nvidia.com)
+
+Status
+
+    XXX - Not complete yet!!!
+
+Version
+
+    1 (2 Oct 2018)
+
+Number
+
+    OpenGL Extension #593
+
+Dependencies
+
+    This extension is written against the OpenGL 4.6 Specification
+    (Compatibility Profile), dated July 30, 2017.
+    but can apply to OpenGL 1.1 and up.
+
+    OpenGL 1.1 is required.
+    GL_NV_vdpau_interop is required.
+    GL_EXT_framebuffer_object affects the definition of this extension.
+    GL_ARB_texture_rectangle affects the definition of this extension.
+    GL_ARB_texture_non_power_of_two affects the definition of this
+    extension.
+
+Overview
+
+    This extension allows VDPAU video surfaces to be used
+    either with frame or field structures for texturing and rendering.
+
+IP Status
+
+    There are no known IP issues. 
+
+New Types
+
+    None
+
+New Procedures and Functions
+
+
+    vdpauSurfaceNV VDPAURegisterVideoSurfaceWithPictureStructureNV (const void *vdpSurface,
+                                                                    enum       target,
+                                                                    sizei      numTextureNames,
+                                                                    const uint *textureNames,
+                                                                    boolean    isFrameStructure);
+
+New Tokens
+
+    None
+
+Additions to Chapter 8 of the OpenGL 4.6 (unabridged) Specification
+(Textures and Samplers)
+    
+    Replace the paragraph that begins with 'The command 
+    vdpauSurfaceNV VDPAURegisterVideoSurfaceNV' and the following two paragraphs,
+    including table 3.8.3.1, with the following:
+
+    The commands
+    
+        vdpauSurfaceNV VDPAURegisterVideoSurfaceNV (const void *vdpSurface,
+                                                    enum       target,
+                                                    sizei      numTextureNames,
+                                                    const uint *textureNames);
+
+        vdpauSurfaceNV VDPAURegisterVideoSurfaceWithPictureStructureNV (const void *vdpSurface,
+                                                                        enum       target,
+                                                                        sizei      numTextureNames,
+                                                                        const uint *textureNames,
+                                                                        boolean    isFrameStructure);
+
+    defines a set of two-dimensional textures, where the image data may
+    be taken from the VdpVideoSurface <vdpSurface>. <target> must be
+    one of TEXTURE_2D or TEXTURE_RECTANGLE. <numTextureNames>
+    determines how many textures are defined. <textureNames> contains
+    the names of the textures that are defined. The surface is
+    transitioned into the registered state.
+    
+    VDPAURegisterVideoSurfaceNV is equivalent to calling 
+    VDPAURegisterVideoSurfaceWithPictureStructureNV with <isFrameStructure> 
+    set to FALSE.
+
+    Legal values for <numTextureNames>,<isFrameStructure> are derived from the
+    VdpChromaType of <vdpSurface>, as defined in table 8.7.1.
+
+                                                                                          Internal
+      VdpChromaType              numTextureNames  isFrameStructure      Index  Size       Format    Content
+      -------------              ---------------  ----------------      -----  ----       --------  -------------------
+      VDP_CHROMA_TYPE_420        4                        0             0      w   x h/2  R8        Top-field luma
+                                                                        1      w   x h/2  R8        Bottom-field luma
+                                                                        2      w/2 x h/4  R8G8      Top-field chroma
+                                                                        3      w/2 x h/4  R8G8      Bottom-field chroma
+      VDP_CHROMA_TYPE_422        4                        0             0      w   x h/2  R8        Top-field luma
+                                                                        1      w   x h/2  R8        Bottom-field luma
+                                                                        2      w/2 x h/2  R8G8      Top-field chroma
+                                                                        3      w/2 x h/2  R8G8      Bottom-field chroma
+      VDP_CHROMA_TYPE_444        4                        0             0      w   x h/2  R8        Top-field luma
+                                                                        1      w   x h/2  R8        Bottom-field luma
+                                                                        2      w   x h/2  R8G8      Top-field chroma
+                                                                        3      w   x h/2  R8G8      Bottom-field chroma
+      VDP_CHROMA_TYPE_420        2                        1             0      w   x h    R8        Luma
+                                                                        1      w/2 x h/2  R8G8      Chroma
+      VDP_CHROMA_TYPE_422        2                        1             0      w   x h    R8        Luma
+                                                                        1      w/2 x h    R8G8      Chroma
+      VDP_CHROMA_TYPE_444        2                        1             0      w   x h    R8        Luma
+                                                                        1      w   x h    R8G8      Chroma
+      VDP_CHROMA_TYPE_420_FIELD  4                        0             0      w   x h/2  R8        Top-field luma
+                                                                        1      w   x h/2  R8        Bottom-field luma
+                                                                        2      w/2 x h/4  R8G8      Top-field chroma
+                                                                        3      w/2 x h/4  R8G8      Bottom-field chroma
+      VDP_CHROMA_TYPE_422_FIELD  4                        0             0      w   x h/2  R8        Top-field luma
+                                                                        1      w   x h/2  R8        Bottom-field luma
+                                                                        2      w/2 x h/2  R8G8      Top-field chroma
+                                                                        3      w/2 x h/2  R8G8      Bottom-field chroma
+      VDP_CHROMA_TYPE_444_FIELD  4                        0             0      w   x h/2  R8        Top-field luma
+                                                                        1      w   x h/2  R8        Bottom-field luma
+                                                                        2      w   x h/2  R8G8      Top-field chroma
+                                                                        3      w   x h/2  R8G8      Bottom-field chroma
+      VDP_CHROMA_TYPE_420_FRAME  2                        1             0      w   x h    R8        Luma
+                                                                        1      w/2 x h/2  R8G8      Chroma
+      VDP_CHROMA_TYPE_422_FRAME  2                        1             0      w   x h    R8        Luma
+                                                                        1      w/2 x h    R8G8      Chroma
+      VDP_CHROMA_TYPE_444_FRAME  2                        1             0      w   x h    R8        Luma
+                                                                        1      w   x h    R8G8      Chroma
+
+      Table 8.7.1: Supported VdpChromaType values, and derived values
+      of <numTextureNames>,<isFrameStructure> and texture parameters for 
+      each texture.
+
+    VDPAURegisterVideoSurfaceWithPictureStructureNV's return value is a handle 
+    used by various other commands detailed in NV_vdpau_interop.
+
+
+Additions to the AGL/GLX/WGL Specifications
+
+    None
+
+Additions to the OpenGL Shading Language
+
+    None
+
+GLX Protocol
+
+    VDPAU implementations currently only support direct-rendering.
+    Consequently, no GLX protocol is currently defined for this
+    extension.
+
+Dependencies on GL_ARB_texture_rectangle
+
+    If GL_ARB_texture_rectangle is not supported, TEXTURE_RECTANGLE may
+    not be used as target for VDPAURegisterVideoSurfaceWithPictureStructureNV.
+
+Dependencies on GL_ARB_texture_non_power_of_two
+
+    If GL_ARB_texture_non_power_of_two is not supported, only VDPAU
+    surfaces with power-of-two size may be used with target TEXTURE_2D.
+
+Errors
+
+    INVALID_OPERATION is generated by 
+    VDPAURegisterVideoSurfaceWithPictureStructureNV if the VDPAU driver
+    refuses the request for some reason.
+
+    INVALID_OPERATION is generated if any texture named by an entry
+    within the <textureNames> parameter of 
+    VDPAURegisterVideoSurfaceWithPictureStructureNV is marked as immutable.
+
+    INVALID_VALUE is generated if the VDPAU surface named by the
+    <vdpSurface> parameter of VDPAURegisterVideoSurfaceWithPictureStructureNV
+    does not have a supported format;
+    see table 8.7.1.
+
+New State
+
+    None
+
+New Implementation State
+
+    None
+
+Issues
+
+
+Revision History
+
+    1. 02 Oct 2018 - Manoj Bonda
+        Initial version
+
+
diff --git a/extensions/OVR/OVR_multiview.txt b/extensions/OVR/OVR_multiview.txt
index 90f192b..5dd1073 100644
--- a/extensions/OVR/OVR_multiview.txt
+++ b/extensions/OVR/OVR_multiview.txt
@@ -36,8 +36,8 @@
 
 Version
 
-    Last Modified Date: July 25, 2018
-    Revision: 5
+    Last Modified Date: October 19, 2018
+    Revision: 6
 
 Number
 
@@ -48,9 +48,12 @@
 
     OpenGL 3.0 or OpenGL ES 3.0 is required.
 
-    This extensions is written against the OpenGL ES 3.2 (November 3, 2016)
+    This extension is written against the OpenGL ES 3.2 (November 3, 2016)
     specification and the OpenGL 4.6 (Core Profile) (July 30, 2017)
 
+    This extension is written against the OpenGL ES Shading Language 3.00.04
+    specification.
+
     This extension interacts with OpenGL 3.3, ARB_timer_query, and
     EXT_disjoint_timer_query.
 
@@ -341,6 +344,13 @@
 
       #extension GL_OVR_multiview : <behavior>
 
+    where <behavior> is as specified in section 3.5.
+
+    A new preprocessor #define is added to the OpenGL ES Shading Language:
+
+      #define GL_OVR_multiview 1
+
+
     In section 4.3.8.1 "Input Layout Qualifiers":
 
     Insert a paragraph before the final one ("Fragment shaders cannot ..."):
@@ -779,4 +789,5 @@
                                 of OES_geometry_shader and OES_tessellation_shader to interop.
                                 Clarify what happens when transform feedback is paused.
       5     07/25/18  oetuaho   Fix off-by-one issue in baseViewIndex + numViews check.
+      6     10/19/18  dgkoch    Add standard boiler plate shader extension language.
 
diff --git a/extensions/OVR/OVR_multiview2.txt b/extensions/OVR/OVR_multiview2.txt
index 91f6568..bef4431 100644
--- a/extensions/OVR/OVR_multiview2.txt
+++ b/extensions/OVR/OVR_multiview2.txt
@@ -16,6 +16,7 @@
     Jan Paul van Waveren, Oculus
     Jan-Harald Fredriksen, ARM
     Sam Holmes, Qualcomm
+    Daniel Koch, NVIDIA
 
 Status
 
@@ -23,8 +24,8 @@
 
 Version
 
-    Last Modified Date:  Mar 18, 2015
-    Author Revision: 0.4
+    Last Modified Date:  October 19, 2018
+    Author Revision: 0.5
 
 Number
 
@@ -35,7 +36,10 @@
 
     OpenGL 3.0 or OpenGL ES 3.0 is required.
 
-    Requires extension OVR_multiview to be implemented.
+    This extension is written against the OpenGL ES Shading Language 3.00.04
+    specification.
+
+    This extension requires OVR_multiview.
 
 Overview
 
@@ -57,14 +61,43 @@
 	Including the following line in a shader can be used to control the language
 	features described in this extension:
 
-      #extension GL_OVR_multiview2
+      #extension GL_OVR_multiview2 : <behavior>
+
+    where <behavior> is as specified in section 3.5.
+
+    A new preprocessor #define is added to the OpenGL ES Shading Language:
+
+      #define GL_OVR_multiview2 1
+
+    If the OVR_multiview2 extension is enabled, the OVR_multiview extension
+    is also implicitly enabled.
+
+    Modifications to Section 7.1 "Built-in Language Variables" (as modified by
+    OVR_multiview):
+
+    Delete the paragraph which states:
+
+    It is a compile- or link-time error if any output variable other
+    than gl_Position is statically dependent on gl_ViewID_OVR. If an
+    output variable other than gl_Position is dynamically dependent on
+    gl_ViewID_OVR, the values are undefined.
 
 Errors
 
+    None.
+
 Issues
 
+    (1) Does enabling GL_OVR_multiview2 automatically enable GL_OVR_multiview?
+
+    RESOLVED: Yes. This was not specified in early drafts of the extension,
+    but this is the behavior of multiple implementations.
+
 Revision History
 
       Rev.    Date    Author    Changes
       ----  --------  --------  -----------------------------------------
       0.1   03/18/15  cass      Initial draft
+      0.5   10/19/18  dgkoch    Add standard boiler plate shader extension language.
+                                Add issue 1 and clarify that this extension
+                                implicitly enables OVR_multiview.
diff --git a/extensions/QCOM/QCOM_YUV_texture_gather.txt b/extensions/QCOM/QCOM_YUV_texture_gather.txt
new file mode 100644
index 0000000..57e11eb
--- /dev/null
+++ b/extensions/QCOM/QCOM_YUV_texture_gather.txt
@@ -0,0 +1,97 @@
+Name
+    QCOM_YUV_texture_gather
+
+Name Strings
+
+    GL_QCOM_YUV_texture_gather
+
+Contact
+
+    Jeff Leger ( jleger 'at' qti.qualcomm.com)
+
+Contributors
+
+    Jeff Leger, Qualcomm
+
+
+Status
+
+    Complete
+
+Version
+
+    Last Modified Date:         October 18, 2018
+    Revision:                   1
+
+Number
+
+    OpenGL ES Extension #307
+
+
+Dependencies
+
+    Requires OpenGL ES 3.0
+    Requires GL_EXT_YUV_target
+    Requires EXT_gpu_shader5
+
+
+Overview
+
+    Extension EXT_gpu_shader5 introduced the texture gather built-in functions.
+    Extension EXT_YUV_target adds the ability to sample from YUV textures, but
+    does not include gather functions.   This extension allows gather function
+    to be used in combination with the YUV textures exposed in EXT_YUV_target.
+
+IP Status
+
+    No known IP claims.
+
+New Procedures and Functions
+
+    None
+
+New Tokens
+
+    None
+
+Modifications to The OpenGL ES Shading Language Specification, Version 3.00,
+dated 29 January 2016.
+
+    Including the following line in a shader can be used to control the
+    language features described in this extension:
+
+      #extension QCOM_YUV_texture_gather : <behavior>
+
+    where <behavior> is as specified in section 3.4.
+
+    A new preprocessor #define is added to the OpenGL ES Shading Language:
+
+      #define QCOM_YUV_texture_gather       1
+
+
+    Add to the list of texture gather functions as introduced with EXT_gpu_shader5
+    and core functionality in ESSL 3.1 the following additional function:
+
+    vec4 textureGather(__samplerExternal2DY2YEXT sampler, vec2 P [, int comp] )
+
+Errors
+
+    None.
+
+New State
+
+    None.
+
+New Implementation Dependent State
+
+    None
+
+Issues
+
+    None.
+
+Revision History
+
+    Rev.    Date      Author    Changes
+    ----  ----------  --------  -----------------------------------------
+    1     2018-10-18  jleger    initial version
diff --git a/extensions/glext.php b/extensions/glext.php
index 7ed507b..56fcdc8 100644
--- a/extensions/glext.php
+++ b/extensions/glext.php
@@ -1001,4 +1001,8 @@
 </li>
 <li value=531><a href="extensions/NV/NV_shading_rate_image.txt">GL_NV_shading_rate_image</a>
 </li>
+<li value=592><a href="extensions/ATI/WGL_ATI_render_texture_rectangle.txt">WGL_ATI_render_texture_rectangle</a>
+</li>
+<li value=593><a href="extensions/NV/NV_vdpau_interop2.txt">GL_NV_vdpau_interop2</a>
+</li>
 </ol>
diff --git a/extensions/registry.py b/extensions/registry.py
old mode 100755
new mode 100644
index dcca74c..b68ff48
--- a/extensions/registry.py
+++ b/extensions/registry.py
@@ -3841,6 +3841,12 @@
         'supporters' : { 'NVIDIA' },
         'url' : 'extensions/NV/NV_vdpau_interop.txt',
     },
+    'GL_NV_vdpau_interop2' : {
+        'number' : 593,
+        'flags' : { 'public' },
+        'supporters' : { 'NVIDIA' },
+        'url' : 'extensions/NV/NV_vdpau_interop2.txt',
+    },
     'GL_NV_vertex_array_range' : {
         'number' : 190,
         'flags' : { 'public' },
@@ -4394,6 +4400,11 @@
         'flags' : { 'public' },
         'url' : 'extensions/QCOM/QCOM_shader_framebuffer_fetch_noncoherent.txt',
     },
+    'GL_QCOM_YUV_texture_gather' : {
+        'esnumber' : 307,
+        'flags' : { 'public' },
+        'url' : 'extensions/QCOM/QCOM_YUV_texture_gather.txt',
+    },
     'GL_QCOM_shader_framebuffer_fetch_rate' : {
         'esnumber' : 304,
         'flags' : { 'public' },
diff --git a/xml/gl.xml b/xml/gl.xml
old mode 100755
new mode 100644
index 61d4fb1..c3b4b02
--- a/xml/gl.xml
+++ b/xml/gl.xml
@@ -29632,6 +29632,14 @@
             <param len="numTextureNames">const <ptype>GLuint</ptype> *<name>textureNames</name></param>
         </command>
         <command>
+            <proto group="vdpauSurfaceNV"><ptype>GLvdpauSurfaceNV</ptype> <name>glVDPAURegisterVideoSurfaceWithPictureStructureNV</name></proto>
+            <param>const void *<name>vdpSurface</name></param>
+            <param><ptype>GLenum</ptype> <name>target</name></param>
+            <param><ptype>GLsizei</ptype> <name>numTextureNames</name></param>
+            <param len="numTextureNames">const <ptype>GLuint</ptype> *<name>textureNames</name></param>
+            <param group="Boolean"><ptype>GLboolean</ptype> <name>isFrameStructure</name></param>
+        </command>
+        <command>
             <proto>void <name>glVDPAUSurfaceAccessNV</name></proto>
             <param group="vdpauSurfaceNV"><ptype>GLvdpauSurfaceNV</ptype> <name>surface</name></param>
             <param><ptype>GLenum</ptype> <name>access</name></param>
@@ -48091,6 +48099,11 @@
                 <command name="glVDPAUUnmapSurfacesNV"/>
             </require>
         </extension>
+        <extension name="GL_NV_vdpau_interop2" supported="gl">
+            <require>
+                <command name="glVDPAURegisterVideoSurfaceWithPictureStructureNV"/>
+            </require>
+        </extension>
         <extension name="GL_NV_vertex_array_range" supported="gl">
             <require>
                 <enum name="GL_VERTEX_ARRAY_RANGE_NV"/>
@@ -49530,6 +49543,8 @@
                 <enum name="GL_WRITEONLY_RENDERING_QCOM"/>
             </require>
         </extension>
+        <extension name="GL_QCOM_YUV_texture_gather" supported="gles2">
+        </extension>
         <extension name="GL_REND_screen_coordinates" supported="gl">
             <require>
                 <enum name="GL_SCREEN_COORDINATES_REND"/>