15bd8deadSopenharmony_ciName 25bd8deadSopenharmony_ci 35bd8deadSopenharmony_ci ARB_ES3_2_compatibility 45bd8deadSopenharmony_ci 55bd8deadSopenharmony_ciName Strings 65bd8deadSopenharmony_ci 75bd8deadSopenharmony_ci GL_ARB_ES3_2_compatibility 85bd8deadSopenharmony_ci 95bd8deadSopenharmony_ciContact 105bd8deadSopenharmony_ci 115bd8deadSopenharmony_ci Piers Daniell, NVIDIA Corporation (pdaniell 'at' nvidia.com) 125bd8deadSopenharmony_ci 135bd8deadSopenharmony_ciContributors 145bd8deadSopenharmony_ci 155bd8deadSopenharmony_ci Daniel Koch, NVIDIA Corporation (dkoch 'at' nvidia.com) 165bd8deadSopenharmony_ci 175bd8deadSopenharmony_ci and contributors to the OpenGL ES 3.2 specification 185bd8deadSopenharmony_ci 195bd8deadSopenharmony_ciNotice 205bd8deadSopenharmony_ci 215bd8deadSopenharmony_ci Copyright (c) 2015 The Khronos Group Inc. Copyright terms at 225bd8deadSopenharmony_ci http://www.khronos.org/registry/speccopyright.html 235bd8deadSopenharmony_ci 245bd8deadSopenharmony_ciSpecification Update Policy 255bd8deadSopenharmony_ci 265bd8deadSopenharmony_ci Khronos-approved extension specifications are updated in response to 275bd8deadSopenharmony_ci issues and bugs prioritized by the Khronos OpenGL Working Group. For 285bd8deadSopenharmony_ci extensions which have been promoted to a core Specification, fixes will 295bd8deadSopenharmony_ci first appear in the latest version of that core Specification, and will 305bd8deadSopenharmony_ci eventually be backported to the extension document. This policy is 315bd8deadSopenharmony_ci described in more detail at 325bd8deadSopenharmony_ci https://www.khronos.org/registry/OpenGL/docs/update_policy.php 335bd8deadSopenharmony_ci 345bd8deadSopenharmony_ciStatus 355bd8deadSopenharmony_ci 365bd8deadSopenharmony_ci Complete. Approved by the ARB on June 26, 2015. 375bd8deadSopenharmony_ci Ratified by the Khronos Board of Promoters on August 7, 2015. 385bd8deadSopenharmony_ci 395bd8deadSopenharmony_ciVersion 405bd8deadSopenharmony_ci 415bd8deadSopenharmony_ci Last Modified Date: June 25, 2015 425bd8deadSopenharmony_ci Revision: 8 435bd8deadSopenharmony_ci 445bd8deadSopenharmony_ciNumber 455bd8deadSopenharmony_ci 465bd8deadSopenharmony_ci ARB Extension #177 475bd8deadSopenharmony_ci 485bd8deadSopenharmony_ciDependencies 495bd8deadSopenharmony_ci 505bd8deadSopenharmony_ci OpenGL 4.5, ARB_ES2_compatibility, ARB_ES3_compatibility and 515bd8deadSopenharmony_ci ARB_ES3_1_compatibility are required. 525bd8deadSopenharmony_ci 535bd8deadSopenharmony_ci KHR_blend_equation_advanced and KHR_texture_compression_astc_ldr are 545bd8deadSopenharmony_ci recommended to support the full OpenGL ES 3.2 feature set, but not 555bd8deadSopenharmony_ci required for this extension. 565bd8deadSopenharmony_ci 575bd8deadSopenharmony_ci This extension is written against The OpenGL 4.5 (Compatibility Profile) 585bd8deadSopenharmony_ci specification. 595bd8deadSopenharmony_ci 605bd8deadSopenharmony_ciOverview 615bd8deadSopenharmony_ci 625bd8deadSopenharmony_ci This extension adds support for features of OpenGL ES 3.2 that are 635bd8deadSopenharmony_ci missing from OpenGL 4.5. Enabling these features will ease the process 645bd8deadSopenharmony_ci of porting applications from OpenGL ES 3.2 to OpenGL. 655bd8deadSopenharmony_ci 665bd8deadSopenharmony_ci In particular this adds the following features: 675bd8deadSopenharmony_ci 685bd8deadSopenharmony_ci - Bounding box used to optimization tessellation processing 695bd8deadSopenharmony_ci (OES_primitive_bounding_box) 705bd8deadSopenharmony_ci - query for MULTISAMPLE_LINE_WIDTH_RANGE_ARB 715bd8deadSopenharmony_ci - support for the OpenGL ES 3.20 shading language 725bd8deadSopenharmony_ci 735bd8deadSopenharmony_ci For full OpenGL ES 3.2 compatibility the implementation must support 745bd8deadSopenharmony_ci KHR_blend_equation_advanced and KHR_texture_compression_astc_ldr. Those 755bd8deadSopenharmony_ci features are not defined in this extension spec since they are already 765bd8deadSopenharmony_ci defined at the KHR level. 775bd8deadSopenharmony_ci 785bd8deadSopenharmony_ciNew Procedures and Functions 795bd8deadSopenharmony_ci 805bd8deadSopenharmony_ci void PrimitiveBoundingBoxARB(float minX, float minY, float minZ, float minW, 815bd8deadSopenharmony_ci float maxX, float maxY, float maxZ, float maxW); 825bd8deadSopenharmony_ci 835bd8deadSopenharmony_ciNew Tokens 845bd8deadSopenharmony_ci 855bd8deadSopenharmony_ci Accepted by the <pname> parameter of GetBooleanv, GetFloatv, GetIntegerv, 865bd8deadSopenharmony_ci and GetInteger64v: 875bd8deadSopenharmony_ci 885bd8deadSopenharmony_ci PRIMITIVE_BOUNDING_BOX_ARB 0x92BE 895bd8deadSopenharmony_ci MULTISAMPLE_LINE_WIDTH_RANGE_ARB 0x9381 905bd8deadSopenharmony_ci MULTISAMPLE_LINE_WIDTH_GRANULARITY_ARB 0x9382 915bd8deadSopenharmony_ci 925bd8deadSopenharmony_ciAdditions to Chapter 11 of the 4.5 Specification (Programmable Vertex 935bd8deadSopenharmony_ciProcessing) 945bd8deadSopenharmony_ci 955bd8deadSopenharmony_ci-- OpenGL: Section 11.2, Tessellation 965bd8deadSopenharmony_ci 975bd8deadSopenharmony_ci Modify section 11.2.1.2.3, "Tessellation Control Shader Outputs": 985bd8deadSopenharmony_ci 995bd8deadSopenharmony_ci In the second paragraph, add gl_BoundingBox[] to the list of built-in 1005bd8deadSopenharmony_ci per-patch output arrays: 1015bd8deadSopenharmony_ci 1025bd8deadSopenharmony_ci Tessellation shaders additionally have three built-in per-patch output 1035bd8deadSopenharmony_ci arrays, gl_TessLevelOuter[], gl_TessLevelInner[], and gl_BoundingBox[]. 1045bd8deadSopenharmony_ci These arrays ... as discussed in the following section. gl_BoundingBox[] 1055bd8deadSopenharmony_ci is an array of two vec4 values that should be used instead of the value of 1065bd8deadSopenharmony_ci PRIMITIVE_BOUNDING_BOX_ARB as the primitive bounding box (see Section 1075bd8deadSopenharmony_ci 14.1pbb) for primitives generated from the output patch. 1085bd8deadSopenharmony_ci 1095bd8deadSopenharmony_ci Modify the sixth paragraph of the section to state that gl_BoundingBox[] 1105bd8deadSopenharmony_ci counts against the per-patch limit: 1115bd8deadSopenharmony_ci 1125bd8deadSopenharmony_ci ... The built-in outputs gl_TessLevelOuter[] and gl_TessLevelInner[] are not 1135bd8deadSopenharmony_ci counted against the per-patch limit. The built-in output 1145bd8deadSopenharmony_ci gl_BoundingBox[], if statically assigned by the shader, is counted 1155bd8deadSopenharmony_ci against the per-patch limit. The total number of components... 1165bd8deadSopenharmony_ci 1175bd8deadSopenharmony_ci 1185bd8deadSopenharmony_ci Modify section 11.2.3.3, "Tessellation Evaluation Shader Inputs": 1195bd8deadSopenharmony_ci 1205bd8deadSopenharmony_ci Insert a new paragraph after the list of special input variables in 1215bd8deadSopenharmony_ci paragraph 2: 1225bd8deadSopenharmony_ci 1235bd8deadSopenharmony_ci The special tessellation control shader output gl_BoundingBox[] is 1245bd8deadSopenharmony_ci consumed by the tessellation primitive generator, and is not available as an 1255bd8deadSopenharmony_ci input to the tessellation evaluation shader. 1265bd8deadSopenharmony_ci 1275bd8deadSopenharmony_ci 1285bd8deadSopenharmony_ci Add new section 14.1pbb following section 14.1, "Discarding Primitives 1295bd8deadSopenharmony_ci Before Rasterization" on p. 525: 1305bd8deadSopenharmony_ci 1315bd8deadSopenharmony_ci 14.1pbb, Primitive Bounding Box 1325bd8deadSopenharmony_ci 1335bd8deadSopenharmony_ci Implementations may be able to optimize performance if the application 1345bd8deadSopenharmony_ci provides bounds of primitives that will be generated by the tessellation 1355bd8deadSopenharmony_ci primitive generator or the geometry shader prior to executing those stages. 1365bd8deadSopenharmony_ci If the provided bounds are incorrect and primitives extend beyond them, the 1375bd8deadSopenharmony_ci rasterizer may or may not generate fragments for the portions of primitives 1385bd8deadSopenharmony_ci outside the bounds. 1395bd8deadSopenharmony_ci 1405bd8deadSopenharmony_ci The primitive bounding box is specified using 1415bd8deadSopenharmony_ci 1425bd8deadSopenharmony_ci void PrimitiveBoundingBoxARB(float minX, float minY, float minZ, float minW, 1435bd8deadSopenharmony_ci float maxX, float maxY, float maxZ, float maxW); 1445bd8deadSopenharmony_ci 1455bd8deadSopenharmony_ci where <minX>, <minY>, <minZ>, and <minW> specify the minimum clip space 1465bd8deadSopenharmony_ci coordinate of the bounding box and <maxX>, <maxY>, <maxZ>, and <maxW> 1475bd8deadSopenharmony_ci specify the maximum coordinate. 1485bd8deadSopenharmony_ci 1495bd8deadSopenharmony_ci If tessellation is active, each invocation of the tessellation control 1505bd8deadSopenharmony_ci shader may re-specify the bounding box by writing to the built-in 1515bd8deadSopenharmony_ci gl_BoundingBox[] variable. If the shader statically assigns a value to 1525bd8deadSopenharmony_ci any part of this variable, then gl_BoundingBox[0] is used instead of 1535bd8deadSopenharmony_ci <minX>, <minY>, <minZ>, <minW>, and gl_BoundingBox[1] is used instead of 1545bd8deadSopenharmony_ci <maxX>, <maxY>, <maxZ>, <maxW>. If the shader contains a static assignment 1555bd8deadSopenharmony_ci to gl_BoundingBox[] and there is an execution path through the shader 1565bd8deadSopenharmony_ci that does not write all components of gl_BoundingBox[], the value of 1575bd8deadSopenharmony_ci unwritten components and corresponding bounding box coordinates is undefined 1585bd8deadSopenharmony_ci for executions of the shader that take that path. 1595bd8deadSopenharmony_ci 1605bd8deadSopenharmony_ci If the tessellation control shader re-specifies the bounding box, the re- 1615bd8deadSopenharmony_ci specified value is used for primitives generated from the output patch by 1625bd8deadSopenharmony_ci the primitive generator, any primitives emitted by the geometry shader 1635bd8deadSopenharmony_ci invocations for those generated primitives, and any primitives further 1645bd8deadSopenharmony_ci introduced during clipping. 1655bd8deadSopenharmony_ci 1665bd8deadSopenharmony_ci The bounding box in clip space is composed of 16 vertices formed by all 1675bd8deadSopenharmony_ci combinations of the minimum and maximum values for each dimension. This 1685bd8deadSopenharmony_ci bounding box is clipped against w_c > 0, and projected to three dimensions 1695bd8deadSopenharmony_ci by dividing x_c, y_c, and z_c by w_c for each vertex. The viewport transform 1705bd8deadSopenharmony_ci is then applied to each vertex to produce a three-dimensional bounding 1715bd8deadSopenharmony_ci volume in window coordinates. 1725bd8deadSopenharmony_ci 1735bd8deadSopenharmony_ci The window space bounding volume is expanded in the X and Y dimensions to 1745bd8deadSopenharmony_ci accomodate the rasterization rules for the primitive type, and to fall on 1755bd8deadSopenharmony_ci fragment boundaries: 1765bd8deadSopenharmony_ci min_wc' = floor(min_wc - size/2.0) 1775bd8deadSopenharmony_ci max_wc' = ceil(max_wc + size/2.0) 1785bd8deadSopenharmony_ci where the min_wc rule is used for x and y window coordinates of bounding 1795bd8deadSopenharmony_ci volume vertices formed from minX and minY respectively, and the max_wc rule 1805bd8deadSopenharmony_ci is used for x and y window coordinates of bounding volume vertices formed 1815bd8deadSopenharmony_ci from maxX and maxY respectively. For point primitives, size is the per- 1825bd8deadSopenharmony_ci primitive point size after clamping to the implementation-defined maximum 1835bd8deadSopenharmony_ci point size as described in section 13.3. For line primitives, size is the 1845bd8deadSopenharmony_ci line width, after rounding and clamping as described in section 13.4.2.1. 1855bd8deadSopenharmony_ci For triangle primitives, size is zero. 1865bd8deadSopenharmony_ci 1875bd8deadSopenharmony_ci During rasterization, the rasterizer will generate fragments with 1885bd8deadSopenharmony_ci window coordinates inside the windows space bounding volume, but may or may 1895bd8deadSopenharmony_ci not generate fragments with window coordinates outside the bounding volume. 1905bd8deadSopenharmony_ci 1915bd8deadSopenharmony_ci 1925bd8deadSopenharmony_ci Modify section 14.5.4, "Line Multisample Rasterization": 1935bd8deadSopenharmony_ci 1945bd8deadSopenharmony_ci Replace the last paragraph with: 1955bd8deadSopenharmony_ci 1965bd8deadSopenharmony_ci Line width range and number of gradations are equivalent to those supported 1975bd8deadSopenharmony_ci for antialiased lines. The supported [min, max] range of multisampled line 1985bd8deadSopenharmony_ci widths, and the width of evenly-space graduations within that range are 1995bd8deadSopenharmony_ci implementation-dependent and may be queried as 2005bd8deadSopenharmony_ci MULTISAMPLE_LINE_WIDTH_RANGE_ARB and MULTISAMPLE_LINE_WIDTH_GRANULARITY_ARB 2015bd8deadSopenharmony_ci respectively, as described in table 23.54. If, for instance the width range 2025bd8deadSopenharmony_ci is from 0.1 to 2.0 and the gradation width is 0.1 then the widths 0.1, 0.2, 2035bd8deadSopenharmony_ci ..., 1.9, 2.0 are supported. Additional line widths may also be supported; 2045bd8deadSopenharmony_ci there is no requirement that these widths be evenly space. If an 2055bd8deadSopenharmony_ci unsupported width is requested, the nearest supported width is used 2065bd8deadSopenharmony_ci instead. 2075bd8deadSopenharmony_ci 2085bd8deadSopenharmony_ciAdditions to the OpenGL Shading Language 2095bd8deadSopenharmony_ci 2105bd8deadSopenharmony_ci Including the following line in a shader can be used to control the 2115bd8deadSopenharmony_ci language features described in this extension: 2125bd8deadSopenharmony_ci 2135bd8deadSopenharmony_ci #extension GL_ARB_ES3_2_compatibility : <behavior> 2145bd8deadSopenharmony_ci 2155bd8deadSopenharmony_ci where <behavior> is as specified in section 3.3. 2165bd8deadSopenharmony_ci 2175bd8deadSopenharmony_ci New preprocessor #defines are added to the OpenGL Shading Language: 2185bd8deadSopenharmony_ci 2195bd8deadSopenharmony_ci #define GL_ARB_ES3_2_compatibility 1 2205bd8deadSopenharmony_ci 2215bd8deadSopenharmony_ci 2225bd8deadSopenharmony_ciAdditions to Chapter 3 of the OpenGL Shading Language 4.50.5 Specification 2235bd8deadSopenharmony_ci(Basics) 2245bd8deadSopenharmony_ci 2255bd8deadSopenharmony_ci Modify the paragraph at the bottom of page 16 in Section 3.3 2265bd8deadSopenharmony_ci (Preprocessor) as follows: 2275bd8deadSopenharmony_ci 2285bd8deadSopenharmony_ci "... Shaders that specify #version 100 will be treated as targeting 2295bd8deadSopenharmony_ci version 1.00 of the OpenGL ES Shading Language. Shaders that specify 2305bd8deadSopenharmony_ci #version 300 will be treated as targeting version 3.00 of the OpenGL 2315bd8deadSopenharmony_ci ES Shading Language. Shaders that specify #version 310 will be treated 2325bd8deadSopenharmony_ci as targeting version 3.10 of the OpenGL ES Shading Language. Shaders 2335bd8deadSopenharmony_ci that specify #version 320 will be treated as targeting version 3.20 2345bd8deadSopenharmony_ci of the OpenGL ES Shading Language...." 2355bd8deadSopenharmony_ci 2365bd8deadSopenharmony_ci Modify the 3rd paragraph at the top of p16 as follows: 2375bd8deadSopenharmony_ci 2385bd8deadSopenharmony_ci A <profile> argument ... 2395bd8deadSopenharmony_ci If version 300, 310 or 320 is specified, the profile argument is not 2405bd8deadSopenharmony_ci optional and must be "es", or a compile-time error results. The Language 2415bd8deadSopenharmony_ci Specification ... 2425bd8deadSopenharmony_ci 2435bd8deadSopenharmony_ci 2445bd8deadSopenharmony_ciAdditions to Chapter 7 of the OpenGL Shading Language 4.50.5 Specification 2455bd8deadSopenharmony_ci(Built-in Variables) 2465bd8deadSopenharmony_ci 2475bd8deadSopenharmony_ci Add a new built-in variable intrinsic declaration after the 2485bd8deadSopenharmony_ci gl_TessLevelOuter and gl_TessLevelInner declarations: 2495bd8deadSopenharmony_ci 2505bd8deadSopenharmony_ci patch out highp vec4 gl_BoundingBox[2]; 2515bd8deadSopenharmony_ci 2525bd8deadSopenharmony_ci 2535bd8deadSopenharmony_ciAdditions to the AGL/GLX/WGL Specifications 2545bd8deadSopenharmony_ci 2555bd8deadSopenharmony_ci None 2565bd8deadSopenharmony_ci 2575bd8deadSopenharmony_ciErrors 2585bd8deadSopenharmony_ci 2595bd8deadSopenharmony_ci TBD 2605bd8deadSopenharmony_ci 2615bd8deadSopenharmony_ciNew State 2625bd8deadSopenharmony_ci 2635bd8deadSopenharmony_ci Add to state values in Table 23.10, Transformation State: 2645bd8deadSopenharmony_ci 2655bd8deadSopenharmony_ci Default 2665bd8deadSopenharmony_ci Get Value Type Get Command Value Description Sec. 2675bd8deadSopenharmony_ci -------------------------- ---- ----------- ------------ ----------------- -------- 2685bd8deadSopenharmony_ci PRIMITIVE_BOUNDING_BOX_ARB 8xR GetFloatv -1,-1,-1, 1, Default primitive 14.1pbb 2695bd8deadSopenharmony_ci 1, 1, 1, 1 bounding box 2705bd8deadSopenharmony_ci 2715bd8deadSopenharmony_ci Add to state values in Table 23.54, Implementation Dependent Values: 2725bd8deadSopenharmony_ci 2735bd8deadSopenharmony_ci Minimum 2745bd8deadSopenharmony_ci Get Value Type Get Command Value Description Sec. 2755bd8deadSopenharmony_ci -------------------------------- ---- ----------- ------- ------------------- -------- 2765bd8deadSopenharmony_ci MULTISAMPLE_LINE_WIDTH_RANGE_ARB 2xR+ GetFloatv 1,1 Range (lo to hi) of 14.5.4 2775bd8deadSopenharmony_ci multisampled line widths 2785bd8deadSopenharmony_ci MULTISAMPLE_LINE_WIDTH_GRANULARITY_ARB R+ GetFloatv - Multisampled line 14.5.4 2795bd8deadSopenharmony_ci width granularity 2805bd8deadSopenharmony_ci 2815bd8deadSopenharmony_ci 2825bd8deadSopenharmony_ciIssues 2835bd8deadSopenharmony_ci 2845bd8deadSopenharmony_ci 1) With this extension, is OpenGL 4.5 a complete superset of OpenGL ES 3.2? 2855bd8deadSopenharmony_ci 2865bd8deadSopenharmony_ci RESOLVED: No. This extension does not include KHR_blend_equation_advanced or 2875bd8deadSopenharmony_ci KHR_texture_compression_astc_ldr even though these are part of OpenGL ES 3.2. 2885bd8deadSopenharmony_ci These continue to be optional extensions for OpenGL. Otherwise OpenGL 4.5 2895bd8deadSopenharmony_ci plus this extension is a superset of OpenGL ES 3.2. 2905bd8deadSopenharmony_ci 2915bd8deadSopenharmony_ciRevision History 2925bd8deadSopenharmony_ci 2935bd8deadSopenharmony_ci Rev. Date Author Changes 2945bd8deadSopenharmony_ci ---- -------- -------- ----------------------------------------------- 2955bd8deadSopenharmony_ci 2965bd8deadSopenharmony_ci 1 04/19/15 pdaniell Initial draft with incomplete text. 2975bd8deadSopenharmony_ci 2985bd8deadSopenharmony_ci 2 04/29/15 pdaniell Remove EXT_texture_sRGB_decode which is no longer 2995bd8deadSopenharmony_ci in OpenGL ES 3.2. 3005bd8deadSopenharmony_ci 3015bd8deadSopenharmony_ci 3 05/07/15 dkoch Add MULTISAMPLED_LINE_WIDTH_RANGE_ARB query 3025bd8deadSopenharmony_ci (Bug 13828). 3035bd8deadSopenharmony_ci Remove ASTC interaction with SRGB_DECODE. 3045bd8deadSopenharmony_ci 3055bd8deadSopenharmony_ci 4 05/07/15 Jon Leech Assign enum for MULTISAMPLED_LINE_WIDTH_RANGE_ARB. 3065bd8deadSopenharmony_ci 3075bd8deadSopenharmony_ci 5 05/21/15 pdaniell Allow KHR_blend_equation_advanced and 3085bd8deadSopenharmony_ci KHR_texture_compression_astc_ldr to be optional 3095bd8deadSopenharmony_ci for this extension. 3105bd8deadSopenharmony_ci 3115bd8deadSopenharmony_ci 6 06/18/15 pdaniell Fix resolution of issue (1). 3125bd8deadSopenharmony_ci 3135bd8deadSopenharmony_ci 7 06/24/15 Jon Leech Correct MULTISAMPLE_LINE_WIDTH_RANGE_ARB 3145bd8deadSopenharmony_ci spelling (drop 'D') 3155bd8deadSopenharmony_ci 3165bd8deadSopenharmony_ci 8 06/25/15 dkoch Add MULTISAMPLE_LINE_WIDTH_GRANULARITY_ARB 3175bd8deadSopenharmony_ci query per bug 13828. 3185bd8deadSopenharmony_ci 319