15bd8deadSopenharmony_ciName 25bd8deadSopenharmony_ci 35bd8deadSopenharmony_ci EXT_tessellation_shader 45bd8deadSopenharmony_ci 55bd8deadSopenharmony_ciName Strings 65bd8deadSopenharmony_ci 75bd8deadSopenharmony_ci GL_EXT_tessellation_shader 85bd8deadSopenharmony_ci GL_EXT_tessellation_point_size 95bd8deadSopenharmony_ci 105bd8deadSopenharmony_ciContact 115bd8deadSopenharmony_ci 125bd8deadSopenharmony_ci Jon Leech (oddhack 'at' sonic.net) 135bd8deadSopenharmony_ci Daniel Koch, NVIDIA (dkoch 'at' nvidia.com) 145bd8deadSopenharmony_ci 155bd8deadSopenharmony_ciContributors 165bd8deadSopenharmony_ci 175bd8deadSopenharmony_ci Daniel Koch, NVIDIA (dkoch 'at' nvidia.com) 185bd8deadSopenharmony_ci Pat Brown, NVIDIA (pbrown 'at' nvidia.com) 195bd8deadSopenharmony_ci Bill Licea-Kane, Qualcomm (billl 'at' qti.qualcomm.com) 205bd8deadSopenharmony_ci Jesse Hall, Google (jessehall 'at' google.com) 215bd8deadSopenharmony_ci Dominik Witczak, Mobica 225bd8deadSopenharmony_ci Jan-Harald Fredriksen, ARM 235bd8deadSopenharmony_ci Maurice Ribble, Qualcomm 245bd8deadSopenharmony_ci Vineet Goel, Qualcomm 255bd8deadSopenharmony_ci Alex Chalfin, ARM 265bd8deadSopenharmony_ci Graham Connor, Imagination 275bd8deadSopenharmony_ci Ben Bowman, Imagination 285bd8deadSopenharmony_ci Jonathan Putsman, Imagination 295bd8deadSopenharmony_ci Slawomir Grajewski, Intel 305bd8deadSopenharmony_ci Contributors to ARB_tessellation_shader 315bd8deadSopenharmony_ci 325bd8deadSopenharmony_ciNotice 335bd8deadSopenharmony_ci 345bd8deadSopenharmony_ci Copyright (c) 2010-2016 The Khronos Group Inc. Copyright terms at 355bd8deadSopenharmony_ci http://www.khronos.org/registry/speccopyright.html 365bd8deadSopenharmony_ci 375bd8deadSopenharmony_ci Portions Copyright (c) 2013-2014 NVIDIA Corporation. 385bd8deadSopenharmony_ci 395bd8deadSopenharmony_ciStatus 405bd8deadSopenharmony_ci 415bd8deadSopenharmony_ci Complete. 425bd8deadSopenharmony_ci 435bd8deadSopenharmony_ciVersion 445bd8deadSopenharmony_ci 455bd8deadSopenharmony_ci Last Modified Date: December 10, 2018 465bd8deadSopenharmony_ci Revision: 25 475bd8deadSopenharmony_ci 485bd8deadSopenharmony_ciNumber 495bd8deadSopenharmony_ci 505bd8deadSopenharmony_ci OpenGL ES Extension #181 515bd8deadSopenharmony_ci 525bd8deadSopenharmony_ciDependencies 535bd8deadSopenharmony_ci 545bd8deadSopenharmony_ci OpenGL ES 3.1 and OpenGL ES Shading Language 3.10 are required. 555bd8deadSopenharmony_ci 565bd8deadSopenharmony_ci This specification is written against the OpenGL ES 3.1 (March 17, 2014) 575bd8deadSopenharmony_ci and OpenGL ES 3.10 Shading Language (March 17, 2014) Specifications. 585bd8deadSopenharmony_ci 595bd8deadSopenharmony_ci EXT_geometry_shader is required in order to share language modifying the 605bd8deadSopenharmony_ci OpenGL ES 3.1 specifications, which would otherwise have to be repeated 615bd8deadSopenharmony_ci here. 625bd8deadSopenharmony_ci 635bd8deadSopenharmony_ci EXT_shader_io_blocks is required. 645bd8deadSopenharmony_ci 655bd8deadSopenharmony_ci EXT_gpu_shader5 is required. 665bd8deadSopenharmony_ci 675bd8deadSopenharmony_ci This extension interacts with OES_shader_multisample_interpolation. 685bd8deadSopenharmony_ci 695bd8deadSopenharmony_ciOverview 705bd8deadSopenharmony_ci 715bd8deadSopenharmony_ci This extension introduces new tessellation stages and two new shader types 725bd8deadSopenharmony_ci to the OpenGL ES primitive processing pipeline. These pipeline stages 735bd8deadSopenharmony_ci operate on a new basic primitive type, called a patch. A patch consists 745bd8deadSopenharmony_ci of a fixed-size collection of vertices, each with per-vertex attributes, 755bd8deadSopenharmony_ci plus a number of associated per-patch attributes. Tessellation control 765bd8deadSopenharmony_ci shaders transform an input patch specified by the application, computing 775bd8deadSopenharmony_ci per-vertex and per-patch attributes for a new output patch. A 785bd8deadSopenharmony_ci fixed-function tessellation primitive generator subdivides the patch, and 795bd8deadSopenharmony_ci tessellation evaluation shaders are used to compute the position and 805bd8deadSopenharmony_ci attributes of each vertex produced by the tessellator. 815bd8deadSopenharmony_ci 825bd8deadSopenharmony_ci When tessellation is active, it begins by running the optional 835bd8deadSopenharmony_ci tessellation control shader. This shader consumes an input patch and 845bd8deadSopenharmony_ci produces a new fixed-size output patch. The output patch consists of an 855bd8deadSopenharmony_ci array of vertices, and a set of per-patch attributes. The per-patch 865bd8deadSopenharmony_ci attributes include tessellation levels that control how finely the patch 875bd8deadSopenharmony_ci will be tessellated. For each patch processed, multiple tessellation 885bd8deadSopenharmony_ci control shader invocations are performed -- one per output patch vertex. 895bd8deadSopenharmony_ci Each tessellation control shader invocation writes all the attributes of 905bd8deadSopenharmony_ci its corresponding output patch vertex. A tessellation control shader may 915bd8deadSopenharmony_ci also read the per-vertex outputs of other tessellation control shader 925bd8deadSopenharmony_ci invocations, as well as read and write shared per-patch outputs. The 935bd8deadSopenharmony_ci tessellation control shader invocations for a single patch effectively run 945bd8deadSopenharmony_ci as a group. A built-in barrier() function is provided to allow 955bd8deadSopenharmony_ci synchronization points where no shader invocation will continue until all 965bd8deadSopenharmony_ci shader invocations have reached the barrier. 975bd8deadSopenharmony_ci 985bd8deadSopenharmony_ci The tessellation primitive generator then decomposes a patch into a new 995bd8deadSopenharmony_ci set of primitives using the tessellation levels to determine how finely 1005bd8deadSopenharmony_ci tessellated the output should be. The primitive generator begins with 1015bd8deadSopenharmony_ci either a triangle or a quad, and splits each outer edge of the primitive 1025bd8deadSopenharmony_ci into a number of segments approximately equal to the corresponding element 1035bd8deadSopenharmony_ci of the outer tessellation level array. The interior of the primitive is 1045bd8deadSopenharmony_ci tessellated according to elements of the inner tessellation level array. 1055bd8deadSopenharmony_ci The primitive generator has three modes: "triangles" and "quads" split a 1065bd8deadSopenharmony_ci triangular or quad-shaped patch into a set of triangles that cover the 1075bd8deadSopenharmony_ci original patch; "isolines" splits a quad-shaped patch into a set of line 1085bd8deadSopenharmony_ci strips running across the patch horizontally. Each vertex generated by 1095bd8deadSopenharmony_ci the tessellation primitive generator is assigned a (u,v) or (u,v,w) 1105bd8deadSopenharmony_ci coordinate indicating its relative location in the subdivided triangle or 1115bd8deadSopenharmony_ci quad. 1125bd8deadSopenharmony_ci 1135bd8deadSopenharmony_ci For each vertex produced by the tessellation primitive generator, the 1145bd8deadSopenharmony_ci tessellation evaluation shader is run to compute its position and other 1155bd8deadSopenharmony_ci attributes of the vertex, using its (u,v) or (u,v,w) coordinate. When 1165bd8deadSopenharmony_ci computing final vertex attributes, the tessellation evaluation shader can 1175bd8deadSopenharmony_ci also read the attributes of any of the vertices of the patch written by 1185bd8deadSopenharmony_ci the tessellation control shader. Tessellation evaluation shader 1195bd8deadSopenharmony_ci invocations are completely independent, although all invocations for a 1205bd8deadSopenharmony_ci single patch share the same collection of input vertices and per-patch 1215bd8deadSopenharmony_ci attributes. 1225bd8deadSopenharmony_ci 1235bd8deadSopenharmony_ci The tessellator operates on vertices after they have been transformed by a 1245bd8deadSopenharmony_ci vertex shader. The primitives generated by the tessellator are passed 1255bd8deadSopenharmony_ci further down the OpenGL ES pipeline, where they can be used as inputs to 1265bd8deadSopenharmony_ci geometry shaders, transform feedback, and the rasterizer. 1275bd8deadSopenharmony_ci 1285bd8deadSopenharmony_ci The tessellation control and evaluation shaders are both optional. If 1295bd8deadSopenharmony_ci neither shader type is present, the tessellation stage has no effect. 1305bd8deadSopenharmony_ci However, if either a tessellation control or a tessellation evaluation 1315bd8deadSopenharmony_ci shader is present, the other must also be present. 1325bd8deadSopenharmony_ci 1335bd8deadSopenharmony_ci Not all tessellation shader implementations have the ability to write the 1345bd8deadSopenharmony_ci point size from a tessellation shader. Thus a second extension string and 1355bd8deadSopenharmony_ci shading language enable are provided for implementations which do 1365bd8deadSopenharmony_ci support tessellation shader point size. 1375bd8deadSopenharmony_ci 1385bd8deadSopenharmony_ci This extension relies on the EXT_shader_io_blocks extension to provide 1395bd8deadSopenharmony_ci the required functionality for declaring input and output blocks and 1405bd8deadSopenharmony_ci interfacing between shaders. 1415bd8deadSopenharmony_ci 1425bd8deadSopenharmony_ci This extension relies on the EXT_gpu_shader5 extension to provide the 1435bd8deadSopenharmony_ci 'precise' and 'fma' functionality which are necessary to ensure crack-free 1445bd8deadSopenharmony_ci tessellation. 1455bd8deadSopenharmony_ci 1465bd8deadSopenharmony_ciIP Status 1475bd8deadSopenharmony_ci 1485bd8deadSopenharmony_ci No known IP claims. 1495bd8deadSopenharmony_ci 1505bd8deadSopenharmony_ciNew Procedures and Functions 1515bd8deadSopenharmony_ci 1525bd8deadSopenharmony_ci void PatchParameteriEXT(enum pname, int value); 1535bd8deadSopenharmony_ci 1545bd8deadSopenharmony_ciNew Tokens 1555bd8deadSopenharmony_ci 1565bd8deadSopenharmony_ci Accepted by the <mode> parameter of DrawArrays, DrawElements, 1575bd8deadSopenharmony_ci and other commands which draw primitives: 1585bd8deadSopenharmony_ci 1595bd8deadSopenharmony_ci PATCHES_EXT 0xE 1605bd8deadSopenharmony_ci 1615bd8deadSopenharmony_ci Accepted by the <pname> parameter of PatchParameteriEXT, GetBooleanv, 1625bd8deadSopenharmony_ci GetFloatv, GetIntegerv, and GetInteger64v: 1635bd8deadSopenharmony_ci 1645bd8deadSopenharmony_ci PATCH_VERTICES_EXT 0x8E72 1655bd8deadSopenharmony_ci 1665bd8deadSopenharmony_ci Accepted by the <pname> parameter of GetProgramiv: 1675bd8deadSopenharmony_ci 1685bd8deadSopenharmony_ci TESS_CONTROL_OUTPUT_VERTICES_EXT 0x8E75 1695bd8deadSopenharmony_ci TESS_GEN_MODE_EXT 0x8E76 1705bd8deadSopenharmony_ci TESS_GEN_SPACING_EXT 0x8E77 1715bd8deadSopenharmony_ci TESS_GEN_VERTEX_ORDER_EXT 0x8E78 1725bd8deadSopenharmony_ci TESS_GEN_POINT_MODE_EXT 0x8E79 1735bd8deadSopenharmony_ci 1745bd8deadSopenharmony_ci Returned by GetProgramiv when <pname> is TESS_GEN_MODE_EXT: 1755bd8deadSopenharmony_ci 1765bd8deadSopenharmony_ci TRIANGLES 1775bd8deadSopenharmony_ci ISOLINES_EXT 0x8E7A 1785bd8deadSopenharmony_ci QUADS_EXT 0x0007 1795bd8deadSopenharmony_ci 1805bd8deadSopenharmony_ci Returned by GetProgramiv when <pname> is TESS_GEN_SPACING_EXT: 1815bd8deadSopenharmony_ci 1825bd8deadSopenharmony_ci EQUAL 1835bd8deadSopenharmony_ci FRACTIONAL_ODD_EXT 0x8E7B 1845bd8deadSopenharmony_ci FRACTIONAL_EVEN_EXT 0x8E7C 1855bd8deadSopenharmony_ci 1865bd8deadSopenharmony_ci Returned by GetProgramiv when <pname> is TESS_GEN_VERTEX_ORDER_EXT: 1875bd8deadSopenharmony_ci 1885bd8deadSopenharmony_ci CCW 1895bd8deadSopenharmony_ci CW 1905bd8deadSopenharmony_ci 1915bd8deadSopenharmony_ci Returned by GetProgramiv when <pname> is TESS_GEN_POINT_MODE_EXT: 1925bd8deadSopenharmony_ci 1935bd8deadSopenharmony_ci FALSE 1945bd8deadSopenharmony_ci TRUE 1955bd8deadSopenharmony_ci 1965bd8deadSopenharmony_ci Accepted by the <pname> parameter of GetBooleanv, GetFloatv, 1975bd8deadSopenharmony_ci GetIntegerv, and GetInteger64v: 1985bd8deadSopenharmony_ci 1995bd8deadSopenharmony_ci MAX_PATCH_VERTICES_EXT 0x8E7D 2005bd8deadSopenharmony_ci MAX_TESS_GEN_LEVEL_EXT 0x8E7E 2015bd8deadSopenharmony_ci MAX_TESS_CONTROL_UNIFORM_COMPONENTS_EXT 0x8E7F 2025bd8deadSopenharmony_ci MAX_TESS_EVALUATION_UNIFORM_COMPONENTS_EXT 0x8E80 2035bd8deadSopenharmony_ci MAX_TESS_CONTROL_TEXTURE_IMAGE_UNITS_EXT 0x8E81 2045bd8deadSopenharmony_ci MAX_TESS_EVALUATION_TEXTURE_IMAGE_UNITS_EXT 0x8E82 2055bd8deadSopenharmony_ci MAX_TESS_CONTROL_OUTPUT_COMPONENTS_EXT 0x8E83 2065bd8deadSopenharmony_ci MAX_TESS_PATCH_COMPONENTS_EXT 0x8E84 2075bd8deadSopenharmony_ci MAX_TESS_CONTROL_TOTAL_OUTPUT_COMPONENTS_EXT 0x8E85 2085bd8deadSopenharmony_ci MAX_TESS_EVALUATION_OUTPUT_COMPONENTS_EXT 0x8E86 2095bd8deadSopenharmony_ci MAX_TESS_CONTROL_UNIFORM_BLOCKS_EXT 0x8E89 2105bd8deadSopenharmony_ci MAX_TESS_EVALUATION_UNIFORM_BLOCKS_EXT 0x8E8A 2115bd8deadSopenharmony_ci MAX_TESS_CONTROL_INPUT_COMPONENTS_EXT 0x886C 2125bd8deadSopenharmony_ci MAX_TESS_EVALUATION_INPUT_COMPONENTS_EXT 0x886D 2135bd8deadSopenharmony_ci MAX_COMBINED_TESS_CONTROL_UNIFORM_COMPONENTS_EXT 0x8E1E 2145bd8deadSopenharmony_ci MAX_COMBINED_TESS_EVALUATION_UNIFORM_COMPONENTS_EXT 0x8E1F 2155bd8deadSopenharmony_ci MAX_TESS_CONTROL_ATOMIC_COUNTER_BUFFERS_EXT 0x92CD 2165bd8deadSopenharmony_ci MAX_TESS_EVALUATION_ATOMIC_COUNTER_BUFFERS_EXT 0x92CE 2175bd8deadSopenharmony_ci MAX_TESS_CONTROL_ATOMIC_COUNTERS_EXT 0x92D3 2185bd8deadSopenharmony_ci MAX_TESS_EVALUATION_ATOMIC_COUNTERS_EXT 0x92D4 2195bd8deadSopenharmony_ci MAX_TESS_CONTROL_IMAGE_UNIFORMS_EXT 0x90CB 2205bd8deadSopenharmony_ci MAX_TESS_EVALUATION_IMAGE_UNIFORMS_EXT 0x90CC 2215bd8deadSopenharmony_ci MAX_TESS_CONTROL_SHADER_STORAGE_BLOCKS_EXT 0x90D8 2225bd8deadSopenharmony_ci MAX_TESS_EVALUATION_SHADER_STORAGE_BLOCKS_EXT 0x90D9 2235bd8deadSopenharmony_ci PRIMITIVE_RESTART_FOR_PATCHES_SUPPORTED 0x8221 2245bd8deadSopenharmony_ci 2255bd8deadSopenharmony_ci Accepted by the <props> parameter of 2265bd8deadSopenharmony_ci GetProgramResourceiv: 2275bd8deadSopenharmony_ci 2285bd8deadSopenharmony_ci IS_PER_PATCH_EXT 0x92E7 2295bd8deadSopenharmony_ci REFERENCED_BY_TESS_CONTROL_SHADER_EXT 0x9307 2305bd8deadSopenharmony_ci REFERENCED_BY_TESS_EVALUATION_SHADER_EXT 0x9308 2315bd8deadSopenharmony_ci 2325bd8deadSopenharmony_ci Accepted by the <type> parameter of CreateShader, by the <pname> 2335bd8deadSopenharmony_ci parameter of GetProgramPipelineiv, and returned by the 2345bd8deadSopenharmony_ci <params> parameter of GetShaderiv: 2355bd8deadSopenharmony_ci 2365bd8deadSopenharmony_ci TESS_EVALUATION_SHADER_EXT 0x8E87 2375bd8deadSopenharmony_ci TESS_CONTROL_SHADER_EXT 0x8E88 2385bd8deadSopenharmony_ci 2395bd8deadSopenharmony_ci Accepted by the <stages> parameter of UseProgramStages: 2405bd8deadSopenharmony_ci 2415bd8deadSopenharmony_ci TESS_CONTROL_SHADER_BIT_EXT 0x00000008 2425bd8deadSopenharmony_ci TESS_EVALUATION_SHADER_BIT_EXT 0x00000010 2435bd8deadSopenharmony_ci 2445bd8deadSopenharmony_ciAdditions to the OpenGL ES 3.1 Specification 2455bd8deadSopenharmony_ci 2465bd8deadSopenharmony_ci Modify chapter 3 "Dataflow Model" 2475bd8deadSopenharmony_ci 2485bd8deadSopenharmony_ci Change the second paragraph, on p. 28: 2495bd8deadSopenharmony_ci 2505bd8deadSopenharmony_ci ... In the next stage vertices may be transformed, followed by assembly 2515bd8deadSopenharmony_ci into geometric primitives. Tessellation and geometry shaders may then 2525bd8deadSopenharmony_ci optionally generate multiple new primitives from single input 2535bd8deadSopenharmony_ci primitives. Optionally, the results ... 2545bd8deadSopenharmony_ci 2555bd8deadSopenharmony_ci 2565bd8deadSopenharmony_ci Modify figure 3.1 "Block diagram of the OpenGL ES pipeline" as modified 2575bd8deadSopenharmony_ci by EXT_geometry_shader to insert new boxes "Tessellation Control 2585bd8deadSopenharmony_ci Shader", "Tessellation Primitive Generation", and "Tessellation 2595bd8deadSopenharmony_ci Evaluation Shader" in sequence following "Vertex Shader" and preceding 2605bd8deadSopenharmony_ci "Geometry Shader". Extend the arrows from the boxes "Image Load/Store" 2615bd8deadSopenharmony_ci .. "Uniform Block" to the right of "Vertex Shader" to connect to the new 2625bd8deadSopenharmony_ci "Control" and "Evaluation" boxes. 2635bd8deadSopenharmony_ci 2645bd8deadSopenharmony_ci 2655bd8deadSopenharmony_ci Replace the two paragraphs of chapter 7, "Programs and Shaders" on p. 64 2665bd8deadSopenharmony_ci starting "Shader stages including ..." with: 2675bd8deadSopenharmony_ci 2685bd8deadSopenharmony_ci Shader stages including vertex, tessellation control, tessellation 2695bd8deadSopenharmony_ci evaluation, geometry, fragment, and compute shaders can be created, 2705bd8deadSopenharmony_ci compiled, and linked into program objects. 2715bd8deadSopenharmony_ci 2725bd8deadSopenharmony_ci Vertex shaders describe the operations that occur on vertex attributes. 2735bd8deadSopenharmony_ci Tessellation control and evaluation shaders are used to control 2745bd8deadSopenharmony_ci the operation of the tessellator (see section 11.1ts). Geometry shaders 2755bd8deadSopenharmony_ci affect the processing of primitives assembled from vertices (see section 2765bd8deadSopenharmony_ci 11.1gs). Fragment shaders affect the processing of fragments during 2775bd8deadSopenharmony_ci rasterization (see chapter 14). A single program object can contain all 2785bd8deadSopenharmony_ci of these shaders, or any subset thereof. 2795bd8deadSopenharmony_ci 2805bd8deadSopenharmony_ci Compute shaders ... 2815bd8deadSopenharmony_ci 2825bd8deadSopenharmony_ci 2835bd8deadSopenharmony_ci Add to table 7.1 "CreateShader <type> values" on p. 65: 2845bd8deadSopenharmony_ci 2855bd8deadSopenharmony_ci <type> Shader Stage 2865bd8deadSopenharmony_ci -------------------------- ------------------------------ 2875bd8deadSopenharmony_ci TESS_CONTROL_SHADER_EXT Tessellation control shader 2885bd8deadSopenharmony_ci TESS_EVALUATION_SHADER_EXT Tessellation evaluation shader 2895bd8deadSopenharmony_ci 2905bd8deadSopenharmony_ci 2915bd8deadSopenharmony_ci Add to the bullet list describing reasons for link failure below the 2925bd8deadSopenharmony_ci LinkProgram command on p. 70, as modified by EXT_geometry_shader: 2935bd8deadSopenharmony_ci 2945bd8deadSopenharmony_ci * The program object contains an object to form a tessellation control 2955bd8deadSopenharmony_ci shader (see section 11.1ts.1), and 2965bd8deadSopenharmony_ci - the program is not separable and contains no object to form a 2975bd8deadSopenharmony_ci vertex shader; or 2985bd8deadSopenharmony_ci - the program is not separable and contains no object to form a 2995bd8deadSopenharmony_ci tessellation evaluation shader; or 3005bd8deadSopenharmony_ci - the output patch vertex count is not specified in the compiled 3015bd8deadSopenharmony_ci tessellation control shader object. 3025bd8deadSopenharmony_ci * The program object contains an object to form a tessellation 3035bd8deadSopenharmony_ci evaluation shader (see section 11.1ts.3), and 3045bd8deadSopenharmony_ci - the program is not separable and contains no object to form a 3055bd8deadSopenharmony_ci vertex shader; or 3065bd8deadSopenharmony_ci - the program is not separable and contains no object to form a 3075bd8deadSopenharmony_ci tessellation control shader; or 3085bd8deadSopenharmony_ci - the tessellation primitive mode is not specified in the compiled 3095bd8deadSopenharmony_ci tessellation evaluation shader object. 3105bd8deadSopenharmony_ci 3115bd8deadSopenharmony_ci 3125bd8deadSopenharmony_ci Modify section 7.3, "Program Objects", as modified by 3135bd8deadSopenharmony_ci EXT_geometry_shader: 3145bd8deadSopenharmony_ci 3155bd8deadSopenharmony_ci Add to the second paragraph after UseProgram on p. 71: 3165bd8deadSopenharmony_ci 3175bd8deadSopenharmony_ci The executable code ... the results of vertex and/or fragment processing 3185bd8deadSopenharmony_ci will be undefined. However, this is not an error. If there is no active 3195bd8deadSopenharmony_ci program for the tessellation control, tessellation evaluation, or 3205bd8deadSopenharmony_ci geometry shader stages, those stages are ignored. If there is no active 3215bd8deadSopenharmony_ci program for the compute shader stage ... 3225bd8deadSopenharmony_ci 3235bd8deadSopenharmony_ci 3245bd8deadSopenharmony_ci Modify section 7.3.1, Program Interfaces: 3255bd8deadSopenharmony_ci 3265bd8deadSopenharmony_ci Modify table 7.2 "GetProgramResourceiv properties and supported 3275bd8deadSopenharmony_ci interfaces" on p. 81 to add "REFERENCED_BY_TESS_CONTROL_SHADER_EXT" and 3285bd8deadSopenharmony_ci "REFERENCED_BY_TESS_EVALUATION_SHADER_EXT" to the "Property" cell 3295bd8deadSopenharmony_ci already containing REFERENCED_BY_<stage>_SHADER for VERTEX, GEOMETRY, 3305bd8deadSopenharmony_ci FRAGMENT, and COMPUTE stages, with the same supported interfaces. 3315bd8deadSopenharmony_ci 3325bd8deadSopenharmony_ci Add to table 7.2: 3335bd8deadSopenharmony_ci 3345bd8deadSopenharmony_ci Property Supported Interfaces 3355bd8deadSopenharmony_ci ---------------------------------------- ----------------------------- 3365bd8deadSopenharmony_ci IS_PER_PATCH_EXT PROGRAM_INPUT, PROGRAM_OUTPUT 3375bd8deadSopenharmony_ci 3385bd8deadSopenharmony_ci Add a new paragraph preceding the paragraph "For property IS_ROW_MAJOR" 3395bd8deadSopenharmony_ci on p. 83: 3405bd8deadSopenharmony_ci 3415bd8deadSopenharmony_ci For the property IS_PER_PATCH_EXT, a single integer identifying whether 3425bd8deadSopenharmony_ci the input or output is a per-patch attribute is written to <params>. If 3435bd8deadSopenharmony_ci the active variable is a per-patch attribute (declared with the "patch" 3445bd8deadSopenharmony_ci qualifier), the value one is written to <params>; otherwise the value 3455bd8deadSopenharmony_ci zero is written to <params>. 3465bd8deadSopenharmony_ci 3475bd8deadSopenharmony_ci 3485bd8deadSopenharmony_ci Add tessellation shaders to the paragraph describing the REFERENCED_BY 3495bd8deadSopenharmony_ci properties, on p. 83: 3505bd8deadSopenharmony_ci 3515bd8deadSopenharmony_ci For the properties REFERENCED_BY_VERTEX_SHADER, 3525bd8deadSopenharmony_ci REFERENCED_BY_TESS_CONTROL_SHADER_EXT, 3535bd8deadSopenharmony_ci REFERENCED_BY_TESS_EVALUATION_SHADER_EXT, 3545bd8deadSopenharmony_ci REFERENCED_BY_GEOMETRY_SHADER_EXT, REFERENCED_BY_FRAGMENT_SHADER, and 3555bd8deadSopenharmony_ci REFERENCED_BY_COMPUTE_SHADER, a single integer is written to <params>, 3565bd8deadSopenharmony_ci identifying whether the active resource is referenced by the vertex, 3575bd8deadSopenharmony_ci tessellation control, tessellation evaluation, geometry, fragment, or 3585bd8deadSopenharmony_ci compute shaders, respectively, in the program object. ... 3595bd8deadSopenharmony_ci 3605bd8deadSopenharmony_ci 3615bd8deadSopenharmony_ci Modify section 7.4, "Program Pipeline Objects" in the first 3625bd8deadSopenharmony_ci paragraph after UseProgramStages on p. 89: 3635bd8deadSopenharmony_ci 3645bd8deadSopenharmony_ci ... These stages may include vertex, tessellation control, tessellation 3655bd8deadSopenharmony_ci evaluation, geometry, fragment, or compute, indicated respectively by 3665bd8deadSopenharmony_ci VERTEX_SHADER_BIT, TESS_CONTROL_SHADER_BIT_EXT, TESS_EVALUATION_BIT_EXT, 3675bd8deadSopenharmony_ci GEOMETRY_SHADER_BIT_EXT, FRAGMENT_SHADER_BIT, or COMPUTE_SHADER_BIT. ... 3685bd8deadSopenharmony_ci 3695bd8deadSopenharmony_ci 3705bd8deadSopenharmony_ci Modify section 7.4.1, "Shader Interface Matching" on p. 91, changing the 3715bd8deadSopenharmony_ci new paragraph starting "Geometry shader per-vertex ...": 3725bd8deadSopenharmony_ci 3735bd8deadSopenharmony_ci Tessellation control shader per-vertex output variables and blocks and 3745bd8deadSopenharmony_ci tessellation control, tessellation evaluation, and geometry shader 3755bd8deadSopenharmony_ci per-vertex input variables are required to be declared as arrays... 3765bd8deadSopenharmony_ci 3775bd8deadSopenharmony_ci 3785bd8deadSopenharmony_ci Modify section 7.4.2 "Program Pipeline Object State" on p. 92, 3795bd8deadSopenharmony_ci replacing the first bullet point: 3805bd8deadSopenharmony_ci 3815bd8deadSopenharmony_ci * Unsigned integers are required to hold the names of the active program 3825bd8deadSopenharmony_ci and each of the current vertex, tessellation control, tessellation 3835bd8deadSopenharmony_ci evaluation, geometry, fragment, and compute stage programs. Each 3845bd8deadSopenharmony_ci integer is initially zero. 3855bd8deadSopenharmony_ci 3865bd8deadSopenharmony_ci 3875bd8deadSopenharmony_ci Modify section 7.6, "Uniform Variables" 3885bd8deadSopenharmony_ci 3895bd8deadSopenharmony_ci Add to table 7.4 "Query targets for default uniform block storage ..." 3905bd8deadSopenharmony_ci on p. 96: 3915bd8deadSopenharmony_ci 3925bd8deadSopenharmony_ci Shader Stage <pname> for querying default uniform block 3935bd8deadSopenharmony_ci storage, in components 3945bd8deadSopenharmony_ci ---------------------------------- ------------------------------------------- 3955bd8deadSopenharmony_ci Tess. control (see sec. 11.1ts.1.1) MAX_TESS_CONTROL_UNIFORM_COMPONENTS_EXT 3965bd8deadSopenharmony_ci Tess. eval (see sec. 11.1ts.3.1) MAX_TESS_EVALUATION_UNIFORM_COMPONENTS_EXT 3975bd8deadSopenharmony_ci 3985bd8deadSopenharmony_ci 3995bd8deadSopenharmony_ci Add to table 7.5 "Query targets for combined uniform block storage ..." 4005bd8deadSopenharmony_ci on p. 96: 4015bd8deadSopenharmony_ci 4025bd8deadSopenharmony_ci 4035bd8deadSopenharmony_ci Shader Stage <pname> for querying combined uniform block 4045bd8deadSopenharmony_ci storage, in components 4055bd8deadSopenharmony_ci ---------------------------------- --------------------------------------------------- 4065bd8deadSopenharmony_ci Tess. control MAX_COMBINED_TESS_CONTROL_UNIFORM_COMPONENTS_EXT 4075bd8deadSopenharmony_ci Tess. eval MAX_COMBINED_TESS_EVALUATION_UNIFORM_COMPONENTS_EXT 4085bd8deadSopenharmony_ci 4095bd8deadSopenharmony_ci 4105bd8deadSopenharmony_ci Modify section 7.6.2, "Uniform Blocks" on p. 104, changing the second 4115bd8deadSopenharmony_ci paragraph of the section: 4125bd8deadSopenharmony_ci 4135bd8deadSopenharmony_ci There is a set of implementation-dependent maximums for the number of 4145bd8deadSopenharmony_ci active uniform blocks used by each shader. If the number of uniform 4155bd8deadSopenharmony_ci blocks used by any shader in the program exceeds its corresponding 4165bd8deadSopenharmony_ci limit, the program will fail to link. The limits for vertex, 4175bd8deadSopenharmony_ci tessellation control, tessellation evaluation, geometry, fragment, and 4185bd8deadSopenharmony_ci compute shaders can be obtained by calling GetIntegerv with <pname> 4195bd8deadSopenharmony_ci values of MAX_VERTEX_UNIFORM_BLOCKS, 4205bd8deadSopenharmony_ci MAX_TESS_CONTROL_UNIFORM_BLOCKS_EXT, 4215bd8deadSopenharmony_ci MAX_TESS_EVALUATION_UNIFORM_BLOCKS_EXT, MAX_GEOMETRY_UNIFORM_BLOCKS_EXT, 4225bd8deadSopenharmony_ci MAX_FRAGMENT_UNIFORM_BLOCKS, and MAX_COMPUTE_UNIFORM_BLOCKS, 4235bd8deadSopenharmony_ci respectively. 4245bd8deadSopenharmony_ci 4255bd8deadSopenharmony_ci 4265bd8deadSopenharmony_ci Modify section 7.7, "Atomic Counter Buffers" on p. 108, changing the 4275bd8deadSopenharmony_ci second paragraph of the section: 4285bd8deadSopenharmony_ci 4295bd8deadSopenharmony_ci There is a set of implementation-dependent maximums for the number of 4305bd8deadSopenharmony_ci active atomic counter buffers referenced by each shader. If the number 4315bd8deadSopenharmony_ci of atomic counter buffers referenced by any shader in the program 4325bd8deadSopenharmony_ci exceeds its corresponding limit, the program will fail to link. The 4335bd8deadSopenharmony_ci limits for vertex, tessellation control, tessellation evaluation, 4345bd8deadSopenharmony_ci geometry, fragment, and compute shaders can be obtained by calling 4355bd8deadSopenharmony_ci GetIntegerv with <pname> values of MAX_VERTEX_ATOMIC_COUNTER_BUFFERS, 4365bd8deadSopenharmony_ci MAX_TESS_CONTROL_ATOMIC_COUNTER_BUFFERS_EXT, 4375bd8deadSopenharmony_ci MAX_TESS_EVALUATION_ATOMIC_COUNTER_BUFFERS_EXT, 4385bd8deadSopenharmony_ci MAX_GEOMETRY_ATOMIC_COUNTER_BUFFERS_EXT, 4395bd8deadSopenharmony_ci MAX_FRAGMENT_ATOMIC_COUNTER_BUFFERS, or 4405bd8deadSopenharmony_ci MAX_COMPUTE_ATOMIC_COUNTER_BUFFERS, respectively. 4415bd8deadSopenharmony_ci 4425bd8deadSopenharmony_ci 4435bd8deadSopenharmony_ci Modify section 7.8, "Shader Buffer Variables and Shader Storage Blocks" 4445bd8deadSopenharmony_ci on p. 110, changing the fourth paragraph: 4455bd8deadSopenharmony_ci 4465bd8deadSopenharmony_ci If the number of active shader storage blocks referenced by the shaders 4475bd8deadSopenharmony_ci in a program exceeds implementation-dependent limits, the program will 4485bd8deadSopenharmony_ci fail to link. The limits for vertex, tessellation control, tessellation 4495bd8deadSopenharmony_ci evaluation, geometry, fragment, and compute shaders can be obtained by 4505bd8deadSopenharmony_ci calling GetIntegerv with pname values of 4515bd8deadSopenharmony_ci MAX_VERTEX_SHADER_STORAGE_BLOCKS, 4525bd8deadSopenharmony_ci MAX_TESS_CONTROL_SHADER_STORAGE_BLOCKS_EXT, 4535bd8deadSopenharmony_ci MAX_TESS_EVALUATION_SHADER_STORAGE_BLOCKS_EXT, 4545bd8deadSopenharmony_ci MAX_GEOMETRY_SHADER_STORAGE_BLOCKS_EXT, 4555bd8deadSopenharmony_ci MAX_FRAGMENT_SHADER_STORAGE_BLOCKS, and 4565bd8deadSopenharmony_ci MAX_COMPUTE_SHADER_STORAGE_BLOCKS, respectively. ... 4575bd8deadSopenharmony_ci 4585bd8deadSopenharmony_ci 4595bd8deadSopenharmony_ci Modify Section 7.11.1, "Shader Memory Access Ordering": 4605bd8deadSopenharmony_ci 4615bd8deadSopenharmony_ci The order in which texture or buffer object memory is read or written by 4625bd8deadSopenharmony_ci shaders is largely undefined. For some shader types (vertex, 4635bd8deadSopenharmony_ci tessellation evaluation, and in some cases, fragment), even the number 4645bd8deadSopenharmony_ci of shader invocations that might perform loads and stores is undefined. 4655bd8deadSopenharmony_ci 4665bd8deadSopenharmony_ci In particular, the following rules apply: 4675bd8deadSopenharmony_ci 4685bd8deadSopenharmony_ci * While a vertex or tessellation evaluation shader will be executed at 4695bd8deadSopenharmony_ci least once for each unique vertex specified by the application (vertex 4705bd8deadSopenharmony_ci shaders) or generated by the tessellation primitive genertor 4715bd8deadSopenharmony_ci (tessellation evaluation shaders), it may be executed more than once 4725bd8deadSopenharmony_ci for implementation-dependent reasons. Additionally, ... 4735bd8deadSopenharmony_ci 4745bd8deadSopenharmony_ci 4755bd8deadSopenharmony_ci Modify section 7.12, "Shader, Program, and Program Pipeline Queries" 4765bd8deadSopenharmony_ci to add to the list of valid <pname>s for GetProgramiv on p. 120: 4775bd8deadSopenharmony_ci 4785bd8deadSopenharmony_ci If <pname> is TESS_CONTROL_OUTPUT_VERTICES_EXT, the number of vertices 4795bd8deadSopenharmony_ci in the tessellation control shader output patch is returned. 4805bd8deadSopenharmony_ci 4815bd8deadSopenharmony_ci If <pname> is TESS_GEN_MODE_EXT, QUADS_EXT, TRIANGLES, or ISOLINES_EXT 4825bd8deadSopenharmony_ci is returned, depending on the primitive mode declaration in the 4835bd8deadSopenharmony_ci tessellation evaluation shader. If <pname> is TESS_GEN_SPACING_EXT, 4845bd8deadSopenharmony_ci EQUAL, FRACTIONAL_EVEN_EXT, or FRACTIONAL_ODD_EXT is returned, depending 4855bd8deadSopenharmony_ci on the spacing declaration in the tessellation evaluation shader. If 4865bd8deadSopenharmony_ci <pname> is TESS_GEN_VERTEX_ORDER_EXT, CCW or CW is returned, depending 4875bd8deadSopenharmony_ci on the vertex order declaration in the tessellation evaluation shader. 4885bd8deadSopenharmony_ci If <pname> is TESS_GEN_POINT_MODE_EXT, TRUE is returned if point mode is 4895bd8deadSopenharmony_ci enabled in a tessellation evaluation shader declaration; FALSE is 4905bd8deadSopenharmony_ci returned otherwise. 4915bd8deadSopenharmony_ci 4925bd8deadSopenharmony_ci 4935bd8deadSopenharmony_ci Add to the Errors for GetProgramiv on p. 121: 4945bd8deadSopenharmony_ci 4955bd8deadSopenharmony_ci An INVALID_OPERATION error is generated if TESS_CONTROL_OUTPUT_VERTICES 4965bd8deadSopenharmony_ci is queried for a program which has not been linked successfully, or 4975bd8deadSopenharmony_ci which does not contain objects to form a tessellation control shader. 4985bd8deadSopenharmony_ci 4995bd8deadSopenharmony_ci An INVALID_OPERATION error is generated if TESS_GEN_MODE, 5005bd8deadSopenharmony_ci TESS_GEN_SPACING, TESS_GEN_VERTEX_ORDER, or TESS_GEN_POINT_MODE are 5015bd8deadSopenharmony_ci queried for a program which has not been linked successfully, or which 5025bd8deadSopenharmony_ci does not contain objects to form a tessellation evaluation shader, 5035bd8deadSopenharmony_ci 5045bd8deadSopenharmony_ci 5055bd8deadSopenharmony_ci Add new section 10.1.7sp following section 10.1.7, "Separate Triangles", 5065bd8deadSopenharmony_ci on p. 234: 5075bd8deadSopenharmony_ci 5085bd8deadSopenharmony_ci Section 10.1.7sp, Separate Patches 5095bd8deadSopenharmony_ci 5105bd8deadSopenharmony_ci Separate patches are specified with mode PATCHES_EXT. A patch is an 5115bd8deadSopenharmony_ci ordered collection of vertices used for primitive tessellation (see 5125bd8deadSopenharmony_ci section 11.1ts). The vertices comprising a patch have no implied 5135bd8deadSopenharmony_ci geometric ordering. The vertices of a patch are used by tessellation 5145bd8deadSopenharmony_ci shaders and the fixed-function tessellator to generate new point, line, 5155bd8deadSopenharmony_ci or triangle primitives. 5165bd8deadSopenharmony_ci 5175bd8deadSopenharmony_ci Each patch in the series has a fixed number of vertices, which is 5185bd8deadSopenharmony_ci specified by calling 5195bd8deadSopenharmony_ci 5205bd8deadSopenharmony_ci void PatchParameteriEXT(enum pname, int value); 5215bd8deadSopenharmony_ci 5225bd8deadSopenharmony_ci with <pname> set to PATCH_VERTICES_EXT. 5235bd8deadSopenharmony_ci 5245bd8deadSopenharmony_ci Errors 5255bd8deadSopenharmony_ci 5265bd8deadSopenharmony_ci An INVALID_ENUM error is generated if <pname> is not PATCH_VERTICES_EXT. 5275bd8deadSopenharmony_ci 5285bd8deadSopenharmony_ci An INVALID_VALUE error is generated if <value> is less than or equal to 5295bd8deadSopenharmony_ci zero, or is greater than the implementation-dependent maximum patch size 5305bd8deadSopenharmony_ci (the value of MAX_PATCH_VERTICES_EXT). The patch size is initially three 5315bd8deadSopenharmony_ci vertices. 5325bd8deadSopenharmony_ci 5335bd8deadSopenharmony_ci If the number of vertices in a patch is given by <v>, the <v>*<i>+1st 5345bd8deadSopenharmony_ci through <v>*<i>+<v>th vertices (in that order) determine a patch for 5355bd8deadSopenharmony_ci each i = 0, 1, ..., n-1, where there are <v>*<n>+<k> vertices. <k> is in 5365bd8deadSopenharmony_ci the range [0,<v>-1]; if <k> is not zero, the final <k> vertices are 5375bd8deadSopenharmony_ci ignored. 5385bd8deadSopenharmony_ci 5395bd8deadSopenharmony_ci 5405bd8deadSopenharmony_ci Add to the end of section 10.3.4, "Primitive Restart" on p. 243: 5415bd8deadSopenharmony_ci 5425bd8deadSopenharmony_ci Implementations are not required to support primitive restart for 5435bd8deadSopenharmony_ci separate patch primitives (primitive type PATCHES_EXT). Support can be 5445bd8deadSopenharmony_ci queried by calling GetBooleanv with the symbolic constant 5455bd8deadSopenharmony_ci PRIMITIVE_RESTART_FOR_PATCHES_SUPPORTED_EXT. A value of FALSE indicates 5465bd8deadSopenharmony_ci that primitive restart is treated as disabled when drawing patches, no 5475bd8deadSopenharmony_ci matter the value of the enable. A value of TRUE indicates that primitive 5485bd8deadSopenharmony_ci restart behaves normally for patches. 5495bd8deadSopenharmony_ci 5505bd8deadSopenharmony_ci 5515bd8deadSopenharmony_ci Modify section 11.1.2.1, "Output Variables" on p. 262, starting with the 5525bd8deadSopenharmony_ci second paragraph of the section: 5535bd8deadSopenharmony_ci 5545bd8deadSopenharmony_ci ... These output variables are used to communicate values to the next 5555bd8deadSopenharmony_ci active stage in the vertex processing pipeline; either the tessellation 5565bd8deadSopenharmony_ci control or geometry shader, or the fixed-function vertex processing 5575bd8deadSopenharmony_ci stages leading to rasterization. 5585bd8deadSopenharmony_ci 5595bd8deadSopenharmony_ci ... 5605bd8deadSopenharmony_ci 5615bd8deadSopenharmony_ci The number of components (individual scalar numeric values) of output 5625bd8deadSopenharmony_ci variables that can be written by the vertex shader, whether or not a 5635bd8deadSopenharmony_ci tessellation control or geometry shader is active, is given by the value 5645bd8deadSopenharmony_ci of the implementation-dependent constant MAX_VERTEX_OUTPUT_COMPONENTS. 5655bd8deadSopenharmony_ci For the purposes of counting ... 5665bd8deadSopenharmony_ci 5675bd8deadSopenharmony_ci ... 5685bd8deadSopenharmony_ci 5695bd8deadSopenharmony_ci Each program object can specify a set of output variables from one 5705bd8deadSopenharmony_ci shader to be recorded in transform feedback mode (see section 2.14). The 5715bd8deadSopenharmony_ci variables that can be recorded are those emitted by the first active 5725bd8deadSopenharmony_ci shader, in order, from the following list: 5735bd8deadSopenharmony_ci 5745bd8deadSopenharmony_ci * geometry shader 5755bd8deadSopenharmony_ci * tessellation evaluation shader 5765bd8deadSopenharmony_ci * vertex shader 5775bd8deadSopenharmony_ci 5785bd8deadSopenharmony_ci The set of variables to record is specified with the command 5795bd8deadSopenharmony_ci 5805bd8deadSopenharmony_ci void TransformFeedbackVaryings ... 5815bd8deadSopenharmony_ci 5825bd8deadSopenharmony_ci 5835bd8deadSopenharmony_ci Modify the bullet point starting "the <count> specified" in the list of 5845bd8deadSopenharmony_ci TransformFeedbackVaryings link failures on p. 263: 5855bd8deadSopenharmony_ci 5865bd8deadSopenharmony_ci * the <count> specified by TransformFeedbackVaryings is non-zero, but 5875bd8deadSopenharmony_ci the program object has no vertex, tessellation evaluation, or geometry 5885bd8deadSopenharmony_ci shader; ... 5895bd8deadSopenharmony_ci 5905bd8deadSopenharmony_ci 5915bd8deadSopenharmony_ci Modify Section 11.1.3, Shader Execution 5925bd8deadSopenharmony_ci 5935bd8deadSopenharmony_ci Change the first paragraph and bullet list on p. 264: 5945bd8deadSopenharmony_ci 5955bd8deadSopenharmony_ci If there is an active program object present for the vertex, 5965bd8deadSopenharmony_ci tessellation control, tessellation evaluation, or geometry shader 5975bd8deadSopenharmony_ci stages, the executable code for those active programs is used to process 5985bd8deadSopenharmony_ci incoming vertex values. The following sequence of operations is 5995bd8deadSopenharmony_ci performed: 6005bd8deadSopenharmony_ci 6015bd8deadSopenharmony_ci * Vertices are processed by the vertex shader (see section 11.1) and 6025bd8deadSopenharmony_ci assembled into primitives as described in sections 10.1 through 10.3. 6035bd8deadSopenharmony_ci * If the current program contains a tessellation control shader, each 6045bd8deadSopenharmony_ci individual patch primitive is processed by the tessellation control 6055bd8deadSopenharmony_ci shader (section 11.1ts.1). Otherwise, primitives are passed through 6065bd8deadSopenharmony_ci unmodified. If active, the tessellation control shader consumes its 6075bd8deadSopenharmony_ci input patch and produces a new patch primitive, which is passed to 6085bd8deadSopenharmony_ci subsequent pipeline stages. 6095bd8deadSopenharmony_ci * If the current program contains a tessellation evaluation shader, each 6105bd8deadSopenharmony_ci individual patch primitive is processed by the tessellation primitive 6115bd8deadSopenharmony_ci generator (section 11.1ts.2) and tessellation evaluation shader (see 6125bd8deadSopenharmony_ci section 11.1ts.3). Otherwise, primitives are passed through unmodified. 6135bd8deadSopenharmony_ci When a tessellation evaluation shader is active, the tessellation 6145bd8deadSopenharmony_ci primitive generator produces a new collection of point, line, or 6155bd8deadSopenharmony_ci triangle primitives to be passed to subsequent pipeline stages. The 6165bd8deadSopenharmony_ci vertices of these primitives are processed by the tessellation 6175bd8deadSopenharmony_ci evaluation shader. The patch primitive passed to the tessellation 6185bd8deadSopenharmony_ci primitive generator is consumed by this process. 6195bd8deadSopenharmony_ci * If the current program contains a geometry shader, ... 6205bd8deadSopenharmony_ci 6215bd8deadSopenharmony_ci 6225bd8deadSopenharmony_ci Modify the bullet list in section 11.1.3.5 "Texture Access" on p. 266 to 6235bd8deadSopenharmony_ci add limits for tessellation shaders: 6245bd8deadSopenharmony_ci 6255bd8deadSopenharmony_ci * MAX_VERTEX_TEXTURE_IMAGE_UNITS (for vertex shaders), 6265bd8deadSopenharmony_ci * MAX_TESS_CONTROL_TEXTURE_IMAGE_UNITS_EXT (for tessellation control 6275bd8deadSopenharmony_ci shaders), 6285bd8deadSopenharmony_ci * MAX_TESS_EVALUATION_TEXTURE_IMAGE_UNITS_EXT (for tessellation 6295bd8deadSopenharmony_ci evaluation shaders), 6305bd8deadSopenharmony_ci * MAX_GEOMETRY_TEXTURE_IMAGE_UNITS_EXT (for geometry shaders), and 6315bd8deadSopenharmony_ci * MAX_TEXTURE_IMAGE_UNITS (for fragment shaders). 6325bd8deadSopenharmony_ci 6335bd8deadSopenharmony_ci 6345bd8deadSopenharmony_ci Modify the bullet list in section 11.1.3.6 "Atomic Counter Access" on p. 6355bd8deadSopenharmony_ci 268 to add a limit for geometry shaders: 6365bd8deadSopenharmony_ci 6375bd8deadSopenharmony_ci * MAX_TESS_CONTROL_ATOMIC_COUNTERS_EXT (for tessellation control 6385bd8deadSopenharmony_ci shaders), 6395bd8deadSopenharmony_ci * MAX_TESS_EVALUATION_ATOMIC_COUNTERS_EXT (for tessellation evaluation 6405bd8deadSopenharmony_ci shaders), 6415bd8deadSopenharmony_ci 6425bd8deadSopenharmony_ci 6435bd8deadSopenharmony_ci Modify the bullet list in section 11.1.3.7 "Image Access" on p. 268 to 6445bd8deadSopenharmony_ci add a limit for geometry shaders: 6455bd8deadSopenharmony_ci 6465bd8deadSopenharmony_ci * MAX_TESS_CONTROL_IMAGE_UNIFORMS_EXT (for tessellation control 6475bd8deadSopenharmony_ci shaders), 6485bd8deadSopenharmony_ci * MAX_TESS_EVALUATION_IMAGE_UNIFORMS_EXT (for tessellation evaluation 6495bd8deadSopenharmony_ci shaders), 6505bd8deadSopenharmony_ci 6515bd8deadSopenharmony_ci 6525bd8deadSopenharmony_ci Modify the bullet list in section 11.1.3.8 "Shader Storage Buffer 6535bd8deadSopenharmony_ci Access" on p. 268 to add a limit for geometry shaders: 6545bd8deadSopenharmony_ci 6555bd8deadSopenharmony_ci * MAX_TESS_CONTROL_SHADER_STORAGE_BLOCKS_EXT (for tessellation control 6565bd8deadSopenharmony_ci shaders), 6575bd8deadSopenharmony_ci * MAX_TESS_EVALUATION_SHADER_STORAGE_BLOCKS_EXT (for tessellation 6585bd8deadSopenharmony_ci evaluation shaders), 6595bd8deadSopenharmony_ci 6605bd8deadSopenharmony_ci 6615bd8deadSopenharmony_ci Modify section 11.1.3.11, "Validation" to replace the bullet point 6625bd8deadSopenharmony_ci starting "There is an active program for the geometry stage ..." on p. 6635bd8deadSopenharmony_ci 270: 6645bd8deadSopenharmony_ci 6655bd8deadSopenharmony_ci * There is an active program for tessellation control, tessellation 6665bd8deadSopenharmony_ci evaluation, or geometry stages with corresponding executable shader, 6675bd8deadSopenharmony_ci but there is no active program with an executable vertex shader. 6685bd8deadSopenharmony_ci 6695bd8deadSopenharmony_ci 6705bd8deadSopenharmony_ci Add a new bullet point in the same section: 6715bd8deadSopenharmony_ci 6725bd8deadSopenharmony_ci * One but not both of the tessellation control and tessellation 6735bd8deadSopenharmony_ci evaluation stages have an active program with corresponding executable 6745bd8deadSopenharmony_ci shader. 6755bd8deadSopenharmony_ci 6765bd8deadSopenharmony_ci 6775bd8deadSopenharmony_ci Insert new section 11.1ts, "Tessellation", between section 11.1 "Vertex 6785bd8deadSopenharmony_ci Shaders" and section 11.1gs "Geometry Shaders": 6795bd8deadSopenharmony_ci 6805bd8deadSopenharmony_ci Tessellation is a process that reads a patch primitive and generates new 6815bd8deadSopenharmony_ci primitives used by subsequent pipeline stages. The generated primitives 6825bd8deadSopenharmony_ci are formed by subdividing a single triangle or quad primitive according 6835bd8deadSopenharmony_ci to fixed or shader-computed levels of detail and transforming each of 6845bd8deadSopenharmony_ci the vertices produced during this subdivision. 6855bd8deadSopenharmony_ci 6865bd8deadSopenharmony_ci Tessellation functionality is controlled by two types of tessellation 6875bd8deadSopenharmony_ci shaders: tessellation control shaders and tessellation evaluation 6885bd8deadSopenharmony_ci shaders. Tessellation is considered active if and only if the active 6895bd8deadSopenharmony_ci program object or program pipeline object includes both a tessellation 6905bd8deadSopenharmony_ci control shader and a tessellation evaluation shader. 6915bd8deadSopenharmony_ci 6925bd8deadSopenharmony_ci The tessellation control shader is used to read an input patch provided 6935bd8deadSopenharmony_ci by the application, and emit an output patch. The tessellation control 6945bd8deadSopenharmony_ci shader is run once for each vertex in the output patch and computes the 6955bd8deadSopenharmony_ci attributes of that vertex. Additionally, the tessellation control shader 6965bd8deadSopenharmony_ci may compute additional per-patch attributes of the output patch. The 6975bd8deadSopenharmony_ci most important per-patch outputs are the tessellation levels, which are 6985bd8deadSopenharmony_ci used to control the number of subdivisions performed by the tessellation 6995bd8deadSopenharmony_ci primitive generator. The tessellation control shader may also write 7005bd8deadSopenharmony_ci additional per-patch attributes for use by the tessellation evaluation 7015bd8deadSopenharmony_ci shader. If no tessellation control shader is active, patch primitives 7025bd8deadSopenharmony_ci may not be provided by the application. 7035bd8deadSopenharmony_ci 7045bd8deadSopenharmony_ci If a tessellation evaluation shader is active, the tessellation 7055bd8deadSopenharmony_ci primitive generator subdivides a triangle or quad primitive into a 7065bd8deadSopenharmony_ci collection of points, lines, or triangles according to the tessellation 7075bd8deadSopenharmony_ci levels of the patch and the set of layout declarations specified in the 7085bd8deadSopenharmony_ci tessellation evaluation shader text. 7095bd8deadSopenharmony_ci 7105bd8deadSopenharmony_ci When a tessellation evaluation shader is active, it is run on each 7115bd8deadSopenharmony_ci vertex generated by the tessellation primitive generator to compute the 7125bd8deadSopenharmony_ci final position and other attributes of the vertex. The tessellation 7135bd8deadSopenharmony_ci evaluation shader can read the relative location of the vertex in the 7145bd8deadSopenharmony_ci subdivided output primitive, given by an (u,v) or (u,v,w) coordinate, as 7155bd8deadSopenharmony_ci well as the position and attributes of any or all of the vertices in the 7165bd8deadSopenharmony_ci input patch. 7175bd8deadSopenharmony_ci 7185bd8deadSopenharmony_ci Tessellation operates only on patch primitives. 7195bd8deadSopenharmony_ci 7205bd8deadSopenharmony_ci Patch primitives are not supported by pipeline stages below the 7215bd8deadSopenharmony_ci tessellation evaluation shader. 7225bd8deadSopenharmony_ci 7235bd8deadSopenharmony_ci A non-separable program object or program pipeline object that includes 7245bd8deadSopenharmony_ci a tessellation shader of any kind must also include a vertex shader. 7255bd8deadSopenharmony_ci 7265bd8deadSopenharmony_ci 7275bd8deadSopenharmony_ci Errors 7285bd8deadSopenharmony_ci 7295bd8deadSopenharmony_ci An INVALID_OPERATION error is generated by any command that transfers 7305bd8deadSopenharmony_ci vertices to the GL if the current program state has one but not both of 7315bd8deadSopenharmony_ci a tessellation control shader and tessellation evaluation shader. 7325bd8deadSopenharmony_ci 7335bd8deadSopenharmony_ci An INVALID_OPERATION error is generated by any command that transfers 7345bd8deadSopenharmony_ci vertices to the GL if tessellation is active and the primitive mode is 7355bd8deadSopenharmony_ci not PATCHES_EXT. 7365bd8deadSopenharmony_ci 7375bd8deadSopenharmony_ci An INVALID_OPERATION error is generated by any command that transfers 7385bd8deadSopenharmony_ci vertices to the GL if tessellation is not active and the primitive mode 7395bd8deadSopenharmony_ci is PATCHES_EXT. 7405bd8deadSopenharmony_ci 7415bd8deadSopenharmony_ci An INVALID_OPERATION error is generated by any command that transfers 7425bd8deadSopenharmony_ci vertices to the GL if the current program state has a tessellation 7435bd8deadSopenharmony_ci shader but no vertex shader. 7445bd8deadSopenharmony_ci 7455bd8deadSopenharmony_ci 7465bd8deadSopenharmony_ci Section 11.1ts.1, Tessellation Control Shaders 7475bd8deadSopenharmony_ci 7485bd8deadSopenharmony_ci The tessellation control shader consumes an input patch provided by the 7495bd8deadSopenharmony_ci application and emits a new output patch. The input patch is an array of 7505bd8deadSopenharmony_ci vertices with attributes corresponding to output variables written by 7515bd8deadSopenharmony_ci the vertex shader. The output patch consists of an array of vertices 7525bd8deadSopenharmony_ci with attributes corresponding to per-vertex output variables written by 7535bd8deadSopenharmony_ci the tessellation control shader and a set of per-patch attributes 7545bd8deadSopenharmony_ci corresponding to per-patch output variables written by the tessellation 7555bd8deadSopenharmony_ci control shader. Tessellation control output variables are per-vertex by 7565bd8deadSopenharmony_ci default, but may be declared as per-patch using the "patch" qualifier. 7575bd8deadSopenharmony_ci 7585bd8deadSopenharmony_ci The number of vertices in the output patch is fixed when the program is 7595bd8deadSopenharmony_ci linked, and is specified in tessellation control shader source code 7605bd8deadSopenharmony_ci using the output layout qualifier "vertices", as described in the OpenGL 7615bd8deadSopenharmony_ci ES Shading Language Specification. A program will fail to link if the 7625bd8deadSopenharmony_ci output patch vertex count is not specified by the tessellation control 7635bd8deadSopenharmony_ci shader object attached to the program, if it is less than or equal to 7645bd8deadSopenharmony_ci zero, or if it is greater than the implementation-dependent maximum 7655bd8deadSopenharmony_ci patch size. The output patch vertex count may be queried by calling 7665bd8deadSopenharmony_ci GetProgramiv with the symbolic constant 7675bd8deadSopenharmony_ci TESS_CONTROL_OUTPUT_VERTICES_EXT. 7685bd8deadSopenharmony_ci 7695bd8deadSopenharmony_ci Tessellation control shaders are created as described in section 7.1, 7705bd8deadSopenharmony_ci using a <type> of TESS_CONTROL_SHADER_EXT. When a new input patch is 7715bd8deadSopenharmony_ci received, the tessellation control shader is run once for each vertex in 7725bd8deadSopenharmony_ci the output patch. The tessellation control shader invocations 7735bd8deadSopenharmony_ci collectively specify the per-vertex and per-patch attributes of the 7745bd8deadSopenharmony_ci output patch. The per-vertex attributes are obtained from the per-vertex 7755bd8deadSopenharmony_ci output variables written by each invocation. Each tessellation control 7765bd8deadSopenharmony_ci shader invocation may only write to per-vertex output variables 7775bd8deadSopenharmony_ci corresponding to its own output patch vertex. The output patch vertex 7785bd8deadSopenharmony_ci number corresponding to a given tessellation control point shader 7795bd8deadSopenharmony_ci invocation is given by the built-in variable gl_InvocationID. Per-patch 7805bd8deadSopenharmony_ci attributes are taken from the per-patch output variables, which may be 7815bd8deadSopenharmony_ci written by any tessellation control shader invocation. While 7825bd8deadSopenharmony_ci tessellation control shader invocations may read any per-vertex and 7835bd8deadSopenharmony_ci per-patch output variable and write any per-patch output variable, 7845bd8deadSopenharmony_ci reading or writing output variables also written by other invocations 7855bd8deadSopenharmony_ci has ordering hazards discussed below. 7865bd8deadSopenharmony_ci 7875bd8deadSopenharmony_ci 7885bd8deadSopenharmony_ci Section 11.1ts.1.1, Tessellation Control Shader Variables 7895bd8deadSopenharmony_ci 7905bd8deadSopenharmony_ci Tessellation control shaders can access uniforms belonging to the 7915bd8deadSopenharmony_ci current program object. Limits on uniform storage and methods for 7925bd8deadSopenharmony_ci manipulating uniforms are described in section 7.6. 7935bd8deadSopenharmony_ci 7945bd8deadSopenharmony_ci Tessellation control shaders also have access to samplers to perform 7955bd8deadSopenharmony_ci texturing operations, as described in section 7.9. 7965bd8deadSopenharmony_ci 7975bd8deadSopenharmony_ci Tessellation control shaders can access the transformed attributes of 7985bd8deadSopenharmony_ci all vertices for their input primitive using input variables. A vertex 7995bd8deadSopenharmony_ci shader writing to output variables generates the values of these input 8005bd8deadSopenharmony_ci variables. Values for any inputs that are not written by a vertex shader 8015bd8deadSopenharmony_ci are undefined. 8025bd8deadSopenharmony_ci 8035bd8deadSopenharmony_ci Additionally, tessellation control shaders can write to one or more 8045bd8deadSopenharmony_ci output variables, including per-vertex attributes for the vertices of 8055bd8deadSopenharmony_ci the output patch and per-patch attributes of the patch. Tessellation 8065bd8deadSopenharmony_ci control shaders can also write to a set of built-in per-vertex and 8075bd8deadSopenharmony_ci per-patch outputs defined in the OpenGL ES Shading Language. The 8085bd8deadSopenharmony_ci per-vertex and per-patch attributes of the output patch are used by the 8095bd8deadSopenharmony_ci tessellation primitive generator (section 11.1ts.2) and may be read by 8105bd8deadSopenharmony_ci tessellation evaluation shader (section 11.1ts.3). 8115bd8deadSopenharmony_ci 8125bd8deadSopenharmony_ci 8135bd8deadSopenharmony_ci Section 11.1ts.1.2, Tessellation Control Shader Execution Environment 8145bd8deadSopenharmony_ci 8155bd8deadSopenharmony_ci If there is an active program for the tessellation control stage, the 8165bd8deadSopenharmony_ci executable version of the program's tessellation control shader is used 8175bd8deadSopenharmony_ci to process patches resulting from the primitive assembly stage. When 8185bd8deadSopenharmony_ci tessellation control shader execution completes, the input patch is 8195bd8deadSopenharmony_ci consumed. A new patch is assembled from the per-vertex and per-patch 8205bd8deadSopenharmony_ci output variables written by the shader and is passed to subsequent 8215bd8deadSopenharmony_ci pipeline stages. 8225bd8deadSopenharmony_ci 8235bd8deadSopenharmony_ci There are several special considerations for tessellation control shader 8245bd8deadSopenharmony_ci execution described in the following sections. 8255bd8deadSopenharmony_ci 8265bd8deadSopenharmony_ci 8275bd8deadSopenharmony_ci Section 11.1ts.1.2.1, Texture Access 8285bd8deadSopenharmony_ci 8295bd8deadSopenharmony_ci Section 11.1.3.1 describes texture lookup functionality accessible to a 8305bd8deadSopenharmony_ci vertex shader. The texel fetch and texture size query functionality 8315bd8deadSopenharmony_ci described there also applies to tessellation control shaders. 8325bd8deadSopenharmony_ci 8335bd8deadSopenharmony_ci 8345bd8deadSopenharmony_ci Section 11.1ts.1.2.2, Tessellation Control Shader Inputs 8355bd8deadSopenharmony_ci 8365bd8deadSopenharmony_ci Section 7.1 ("Built-In Variables") of the OpenGL ES Shading Language 8375bd8deadSopenharmony_ci Specification describes the built-in variable array gl_in[] available as 8385bd8deadSopenharmony_ci input to a tessellation control shader. gl_in[] receives values from 8395bd8deadSopenharmony_ci equivalent built-in output variables written by the vertex shader. Each 8405bd8deadSopenharmony_ci array element of gl_in[] is a structure holding values for a specific 8415bd8deadSopenharmony_ci vertex of the input patch. The length of gl_in[] is equal to the 8425bd8deadSopenharmony_ci implementation-dependent maximum patch size (gl_MaxPatchVertices). 8435bd8deadSopenharmony_ci Behavior is undefined if gl_in[] is indexed with a vertex index greater 8445bd8deadSopenharmony_ci than or equal to the current patch size. The members of each element of 8455bd8deadSopenharmony_ci the gl_in[] array are gl_Position 8465bd8deadSopenharmony_ci [[ If EXT_tessellation_point_size is supported: ]] 8475bd8deadSopenharmony_ci and gl_PointSize. 8485bd8deadSopenharmony_ci 8495bd8deadSopenharmony_ci Tessellation control shaders have available several other special input 8505bd8deadSopenharmony_ci variables not replicated per-vertex and not contained in gl_in[], 8515bd8deadSopenharmony_ci including: 8525bd8deadSopenharmony_ci 8535bd8deadSopenharmony_ci * The variable gl_PatchVerticesIn holds the number of vertices in the 8545bd8deadSopenharmony_ci input patch being processed by the tessellation control shader. 8555bd8deadSopenharmony_ci 8565bd8deadSopenharmony_ci * The variable gl_PrimitiveID is filled with the number of primitives 8575bd8deadSopenharmony_ci processed by the drawing command which generated the input vertices. 8585bd8deadSopenharmony_ci The first primitive generated by a drawing command is numbered zero, 8595bd8deadSopenharmony_ci and the primitive ID counter is incremented after every individual 8605bd8deadSopenharmony_ci point, line, or triangle primitive is processed. The counter is 8615bd8deadSopenharmony_ci reset to zero between each instance drawn. Restarting a primitive 8625bd8deadSopenharmony_ci topology using the primitive restart index has no effect on the 8635bd8deadSopenharmony_ci primitive ID counter. 8645bd8deadSopenharmony_ci 8655bd8deadSopenharmony_ci * The variable gl_InvocationID holds an invocation number for the 8665bd8deadSopenharmony_ci current tessellation control shader invocation. Tessellation control 8675bd8deadSopenharmony_ci shaders are invoked once per output patch vertex, and invocations 8685bd8deadSopenharmony_ci are numbered beginning with zero. 8695bd8deadSopenharmony_ci 8705bd8deadSopenharmony_ci Similarly to the built-in inputs, each user-defined input variable has a 8715bd8deadSopenharmony_ci value for each vertex and thus needs to be declared as arrays or inside 8725bd8deadSopenharmony_ci input blocks declared as arrays. Declaring an array size is optional. If 8735bd8deadSopenharmony_ci no size is specified, it will be taken from the implementation-dependent 8745bd8deadSopenharmony_ci maximum patch size (gl_MaxPatchVertices). If a size is specified, it must 8755bd8deadSopenharmony_ci match the maximum patch size; otherwise, a compile or link error will 8765bd8deadSopenharmony_ci occur. Since the array size may be larger than the number of vertices 8775bd8deadSopenharmony_ci found in the input patch, behavior is undefined if a per-vertex input 8785bd8deadSopenharmony_ci variable is accessed using an index greater than or equal to the number of 8795bd8deadSopenharmony_ci vertices in the input patch. The OpenGL ES Shading Language doesn't 8805bd8deadSopenharmony_ci support multi-dimensional arrays as shader inputs or outputs; therefore, 8815bd8deadSopenharmony_ci user-defined tessellation control shader inputs corresponding to vertex 8825bd8deadSopenharmony_ci shader outputs declared as arrays must be declared as array members of 8835bd8deadSopenharmony_ci an input block that is itself declared as an array. 8845bd8deadSopenharmony_ci 8855bd8deadSopenharmony_ci Similarly to the limit on vertex shader output components (see section 8865bd8deadSopenharmony_ci 11.1.2.1), there is a limit on the number of components of input 8875bd8deadSopenharmony_ci variables that can be read by the tessellation control shader, given by 8885bd8deadSopenharmony_ci the value of the implementation-dependent constant 8895bd8deadSopenharmony_ci MAX_TESS_CONTROL_INPUT_COMPONENTS_EXT. 8905bd8deadSopenharmony_ci 8915bd8deadSopenharmony_ci When a program is linked, all components of any input read by a 8925bd8deadSopenharmony_ci tessellation control shader will count against this limit. A program 8935bd8deadSopenharmony_ci whose tessellation control shader exceeds this limit may fail to link, 8945bd8deadSopenharmony_ci unless device-dependent optimizations are able to make the program fit 8955bd8deadSopenharmony_ci within available hardware resources. 8965bd8deadSopenharmony_ci 8975bd8deadSopenharmony_ci Component counting rules for different variable types and variable 8985bd8deadSopenharmony_ci declarations are the same as for MAX_VERTEX_OUTPUT_COMPONENTS (see 8995bd8deadSopenharmony_ci section 11.1.2.1). 9005bd8deadSopenharmony_ci 9015bd8deadSopenharmony_ci 9025bd8deadSopenharmony_ci Section 11.1ts.1.2.3, Tessellation Control Shader Outputs 9035bd8deadSopenharmony_ci 9045bd8deadSopenharmony_ci Section 7.1 ("Built-In Variables") of the OpenGL ES Shading Language 9055bd8deadSopenharmony_ci Specification describes the built-in variable array gl_out[] available 9065bd8deadSopenharmony_ci as an output for a tessellation control shader. gl_out[] passes values 9075bd8deadSopenharmony_ci to equivalent built-in input variables read by subsequent shader stages 9085bd8deadSopenharmony_ci or to subsequent fixed functionality vertex processing pipeline stages. 9095bd8deadSopenharmony_ci Each array element of gl_out[] is a structure holding values for a 9105bd8deadSopenharmony_ci specific vertex of the output patch. The length of gl_out[] is equal to 9115bd8deadSopenharmony_ci the output patch size specified in the tessellation control shader 9125bd8deadSopenharmony_ci output layout declaration. The members of each element of the gl_out[] 9135bd8deadSopenharmony_ci array are gl_Position 9145bd8deadSopenharmony_ci [[ If EXT_tessellation_point_size is supported: ]] 9155bd8deadSopenharmony_ci and gl_PointSize. 9165bd8deadSopenharmony_ci They behave identically to equivalently named vertex shader outputs 9175bd8deadSopenharmony_ci (see section 11.1.2.1). 9185bd8deadSopenharmony_ci 9195bd8deadSopenharmony_ci Tessellation shaders additionally have two built-in per-patch output 9205bd8deadSopenharmony_ci arrays, gl_TessLevelOuter[] and gl_TessLevelInner[]. These arrays are not 9215bd8deadSopenharmony_ci replicated for each output patch vertices and are not members of gl_out[]. 9225bd8deadSopenharmony_ci gl_TessLevelOuter[] is an array of four floating-point values specifying 9235bd8deadSopenharmony_ci the approximate number of segments that the tessellation primitive 9245bd8deadSopenharmony_ci generator should use when subdividing each outer edge of the primitive it 9255bd8deadSopenharmony_ci subdivides. gl_TessLevelInner[] is an array of two floating-point values 9265bd8deadSopenharmony_ci specifying the approximate number of segments used to produce a 9275bd8deadSopenharmony_ci regularly-subdivided primitive interior. The values written to 9285bd8deadSopenharmony_ci gl_TessLevelOuter and gl_TessLevelInner need not be integers, and their 9295bd8deadSopenharmony_ci interpretation depends on the type of primitive the tessellation 9305bd8deadSopenharmony_ci primitive generator will subdivide and other tessellation parameters, as 9315bd8deadSopenharmony_ci discussed in the following section. 9325bd8deadSopenharmony_ci 9335bd8deadSopenharmony_ci A tessellation control shader may also declare user-defined per-vertex 9345bd8deadSopenharmony_ci output variables. User-defined per-vertex output variables are declared 9355bd8deadSopenharmony_ci with the qualifier "out" and have a value for each vertex in the output 9365bd8deadSopenharmony_ci patch. Such variables must be declared as arrays or inside output blocks 9375bd8deadSopenharmony_ci declared as arrays. Declaring an array size is optional. If no size is 9385bd8deadSopenharmony_ci specified, it will be taken from output patch size declared in the 9395bd8deadSopenharmony_ci shader. If a size is specified, it must match the maximum patch size; 9405bd8deadSopenharmony_ci otherwise, a compile or link error will occur. The OpenGL ES Shading 9415bd8deadSopenharmony_ci Language doesn't support multi-dimensional arrays as shader inputs or 9425bd8deadSopenharmony_ci outputs; therefore, user-defined per-vertex tessellation control shader 9435bd8deadSopenharmony_ci outputs with multiple elements per vertex must be declared as array members 9445bd8deadSopenharmony_ci of an output block that is itself declared as an array. 9455bd8deadSopenharmony_ci 9465bd8deadSopenharmony_ci While per-vertex output variables are declared as arrays indexed by 9475bd8deadSopenharmony_ci vertex number, each tessellation control shader invocation may write 9485bd8deadSopenharmony_ci only to those outputs corresponding to its output patch vertex. 9495bd8deadSopenharmony_ci Tessellation control shaders must use the special variable 9505bd8deadSopenharmony_ci gl_InvocationID as the vertex number index when writing to per-vertex 9515bd8deadSopenharmony_ci output variables. 9525bd8deadSopenharmony_ci 9535bd8deadSopenharmony_ci Additionally, a tessellation control shader may declare per-patch output 9545bd8deadSopenharmony_ci variables using the qualifier "patch out". Unlike per-vertex outputs, 9555bd8deadSopenharmony_ci per-patch outputs do not correspond to any specific vertex in the patch, 9565bd8deadSopenharmony_ci and are not indexed by vertex number. Per-patch outputs declared as 9575bd8deadSopenharmony_ci arrays have multiple values for the output patch; similarly declared 9585bd8deadSopenharmony_ci per-vertex outputs would indicate a single value for each vertex in the 9595bd8deadSopenharmony_ci output patch. User-defined per-patch outputs are not used by the 9605bd8deadSopenharmony_ci tessellation primitive generator, but may be read by tessellation 9615bd8deadSopenharmony_ci evaluation shaders. 9625bd8deadSopenharmony_ci 9635bd8deadSopenharmony_ci There are several limits on the number of components of built-in and 9645bd8deadSopenharmony_ci user-defined output variables that can be written by the tessellation 9655bd8deadSopenharmony_ci control shader. The number of components of active per-vertex output 9665bd8deadSopenharmony_ci variables may not exceed the value of 9675bd8deadSopenharmony_ci MAX_TESS_CONTROL_OUTPUT_COMPONENTS_EXT. The number of components of 9685bd8deadSopenharmony_ci active per-patch output variables may not exceed the value of 9695bd8deadSopenharmony_ci MAX_TESS_PATCH_COMPONENTS_EXT. The built-in outputs gl_TessLevelOuter[] 9705bd8deadSopenharmony_ci and gl_TessLevelInner[] are not counted against the per-patch limit. The 9715bd8deadSopenharmony_ci total number of components of active per-vertex and per-patch outputs is 9725bd8deadSopenharmony_ci derived by multiplying the per-vertex output component count by the output 9735bd8deadSopenharmony_ci patch size and then adding the per-patch output component count. The total 9745bd8deadSopenharmony_ci component count may not exceed 9755bd8deadSopenharmony_ci MAX_TESS_CONTROL_TOTAL_OUTPUT_COMPONENTS_EXT. 9765bd8deadSopenharmony_ci 9775bd8deadSopenharmony_ci When a program is linked, all components of any output variable written 9785bd8deadSopenharmony_ci by a tessellation control shader will count against this limit. A 9795bd8deadSopenharmony_ci program exceeding any of these limits may fail to link, unless 9805bd8deadSopenharmony_ci device-dependent optimizations are able to make the program fit within 9815bd8deadSopenharmony_ci available hardware resources. 9825bd8deadSopenharmony_ci 9835bd8deadSopenharmony_ci Component counting rules for different variable types and variable 9845bd8deadSopenharmony_ci declarations are the same as for MAX_VERTEX_OUTPUT_COMPONENTS. (see 9855bd8deadSopenharmony_ci section 11.1.2.1). 9865bd8deadSopenharmony_ci 9875bd8deadSopenharmony_ci 9885bd8deadSopenharmony_ci Section 11.1ts.1.2.4, Tessellation Control Shader Execution Order 9895bd8deadSopenharmony_ci 9905bd8deadSopenharmony_ci For tessellation control shaders with a declared output patch size 9915bd8deadSopenharmony_ci greater than one, the shader is invoked more than once for each input 9925bd8deadSopenharmony_ci patch. The order of execution of one tessellation control shader 9935bd8deadSopenharmony_ci invocation relative to the other invocations for the same input patch is 9945bd8deadSopenharmony_ci largely undefined. The built-in function barrier() provides some control 9955bd8deadSopenharmony_ci over relative execution order. When a tessellation control shader calls 9965bd8deadSopenharmony_ci the barrier() function, its execution pauses until all other invocations 9975bd8deadSopenharmony_ci have also called the same function. Output variable assignments 9985bd8deadSopenharmony_ci performed by any invocation executed prior to calling barrier() will be 9995bd8deadSopenharmony_ci visible to any other invocation after the call to barrier() returns. 10005bd8deadSopenharmony_ci Shader output values read in one invocation but written by another may 10015bd8deadSopenharmony_ci be undefined without proper use of barrier(); full rules are found in 10025bd8deadSopenharmony_ci the OpenGL ES Shading Language Specification. 10035bd8deadSopenharmony_ci 10045bd8deadSopenharmony_ci The barrier() function may only be called inside the main entry point of 10055bd8deadSopenharmony_ci the tessellation control shader and may not be called in potentially 10065bd8deadSopenharmony_ci divergent flow control. In particular, barrier() may not be called 10075bd8deadSopenharmony_ci inside a switch statement, in either sub-statement of an if statement, 10085bd8deadSopenharmony_ci inside a do, for, or while loop, or at any point after a return 10095bd8deadSopenharmony_ci statement in the function main(). 10105bd8deadSopenharmony_ci 10115bd8deadSopenharmony_ci 10125bd8deadSopenharmony_ci Section 11.1ts.2, Tessellation Primitive Generation 10135bd8deadSopenharmony_ci 10145bd8deadSopenharmony_ci The tessellation primitive generator consumes the input patch and 10155bd8deadSopenharmony_ci produces a new set of basic primitives (points, lines, or triangles). 10165bd8deadSopenharmony_ci These primitives are produced by subdividing a geometric primitive 10175bd8deadSopenharmony_ci (rectangle or triangle) according to the per-patch tessellation levels 10185bd8deadSopenharmony_ci written by the tessellation control shader. This subdivision is 10195bd8deadSopenharmony_ci performed in an implementation- dependent manner. 10205bd8deadSopenharmony_ci 10215bd8deadSopenharmony_ci The type of subdivision performed by the tessellation primitive 10225bd8deadSopenharmony_ci generator is specified by an input layout declaration in the 10235bd8deadSopenharmony_ci tessellation evaluation shader using one of the identifiers "triangles", 10245bd8deadSopenharmony_ci "quads", and "isolines". For "triangles", the primitive generator 10255bd8deadSopenharmony_ci subdivides a triangle primitive into smaller triangles. For "quads", the 10265bd8deadSopenharmony_ci primitive generator subdivides a rectangle primitive into smaller 10275bd8deadSopenharmony_ci triangles. For "isolines", the primitive generator subdivides a 10285bd8deadSopenharmony_ci rectangle primitive into a collection of line segments arranged in 10295bd8deadSopenharmony_ci strips stretching horizontally across the rectangle. Each vertex 10305bd8deadSopenharmony_ci produced by the primitive generator has an associated (u,v,w) or (u,v) 10315bd8deadSopenharmony_ci position in a normalized parameter space, with parameter values in the 10325bd8deadSopenharmony_ci range [0,1], as illustrated in Figure 11.X1. For "triangles", the vertex 10335bd8deadSopenharmony_ci position is a barycentric coordinate (u,v,w), where u+v+w==1, and 10345bd8deadSopenharmony_ci indicates the relative influence of the three vertices of the triangle 10355bd8deadSopenharmony_ci on the position of the vertex. For "quads" and "isolines", the position 10365bd8deadSopenharmony_ci is a (u,v) coordinate indicating the relative horizontal and vertical 10375bd8deadSopenharmony_ci position of the vertex relative to the subdivided rectangle. The 10385bd8deadSopenharmony_ci subdivision process is explained in more detail in subsequent sections. 10395bd8deadSopenharmony_ci 10405bd8deadSopenharmony_ci (0,1) OL3 (1,1) (0,1,0) (0,1) (1,1) 10415bd8deadSopenharmony_ci +--------------+ + ^ + <no edge> + 10425bd8deadSopenharmony_ci | | / \ | 10435bd8deadSopenharmony_ci | +--------+ | / \ | +--------------+ 10445bd8deadSopenharmony_ci | | IL0 | | OL0 / + \ OL2 | 10455bd8deadSopenharmony_ci OL0| |IL1 | |OL2 / / \ \ | +--------------+ 10465bd8deadSopenharmony_ci | | | | / /IL0\ \ OL0 10475bd8deadSopenharmony_ci | +--------+ | / +-----+ \ | +--------------+ 10485bd8deadSopenharmony_ci | | / \ | 10495bd8deadSopenharmony_ci +--------------+ +---------------+ v +--------------+ 10505bd8deadSopenharmony_ci (0,0) OL1 (1,0) (0,0,1) OL1 (1,0,0) (0,0) OL1 (1,0) 10515bd8deadSopenharmony_ci 10525bd8deadSopenharmony_ci quads triangles isolines 10535bd8deadSopenharmony_ci 10545bd8deadSopenharmony_ci Figure 11.X1: Domain parameterization for tessellation generator 10555bd8deadSopenharmony_ci primitive modes (triangles, quads, or isolines). The coordinates 10565bd8deadSopenharmony_ci illustrate the value of gl_TessCoord at the corners of the domain. The 10575bd8deadSopenharmony_ci labels on the edges indicate the inner (IL0 and IL1) and outer (OL0 10585bd8deadSopenharmony_ci through OL3) tessellation level values used to control the number of 10595bd8deadSopenharmony_ci subdivisions along each edge of the domain. 10605bd8deadSopenharmony_ci 10615bd8deadSopenharmony_ci A patch is discarded by the tessellation primitive generator if any 10625bd8deadSopenharmony_ci relevant outer tessellation level is less than or equal to zero. Patches 10635bd8deadSopenharmony_ci will also be discarded if any relevant outer tessellation level 10645bd8deadSopenharmony_ci corresponds to a floating-point NaN (not a number) in implementations 10655bd8deadSopenharmony_ci supporting NaN. When patches are discarded, no new primitives will be 10665bd8deadSopenharmony_ci generated and the tessellation evaluation program will not be run. For 10675bd8deadSopenharmony_ci "quads", all four outer levels are relevant. For "triangles" and 10685bd8deadSopenharmony_ci "isolines", only the first three or two outer levels, respectively, are 10695bd8deadSopenharmony_ci relevant. Negative inner levels will not cause a patch to be discarded; 10705bd8deadSopenharmony_ci they will be clamped as described below. 10715bd8deadSopenharmony_ci 10725bd8deadSopenharmony_ci Each of the tessellation levels is used to determine the number and 10735bd8deadSopenharmony_ci spacing of segments used to subdivide a corresponding edge. The method 10745bd8deadSopenharmony_ci used to derive the number and spacing of segments is specified by an 10755bd8deadSopenharmony_ci input layout declaration in the tessellation evaluation shader using one 10765bd8deadSopenharmony_ci of the identifiers "equal_spacing", "fractional_even_spacing", or 10775bd8deadSopenharmony_ci "fractional_odd_spacing". If no spacing is specified in the tessellation 10785bd8deadSopenharmony_ci evaluation shader, "equal_spacing" will be used. 10795bd8deadSopenharmony_ci 10805bd8deadSopenharmony_ci If "equal_spacing" is used, the floating-point tessellation level is 10815bd8deadSopenharmony_ci first clamped to the range [1,<max>], where <max> is the 10825bd8deadSopenharmony_ci implementation-dependent maximum tessellation level (the value of 10835bd8deadSopenharmony_ci MAX_TESS_GEN_LEVEL_EXT). The result is rounded up to the nearest integer 10845bd8deadSopenharmony_ci <n>, and the corresponding edge is divided into <n> segments of equal 10855bd8deadSopenharmony_ci length in (u,v) space. 10865bd8deadSopenharmony_ci 10875bd8deadSopenharmony_ci If "fractional_even_spacing" is used, the tessellation level is first 10885bd8deadSopenharmony_ci clamped to the range [2,<max>] and then rounded up to the nearest even 10895bd8deadSopenharmony_ci integer <n>. If "fractional_odd_spacing" is used, the tessellation level 10905bd8deadSopenharmony_ci is clamped to the range [1,<max>-1] and then rounded up to the nearest 10915bd8deadSopenharmony_ci odd integer <n>. If <n> is one, the edge will not be subdivided. 10925bd8deadSopenharmony_ci Otherwise, the corresponding edge will be divided into <n>-2 segments of 10935bd8deadSopenharmony_ci equal length, and two additional segments of equal length that are 10945bd8deadSopenharmony_ci typically shorter than the other segments. The length of the two 10955bd8deadSopenharmony_ci additional segments relative to the others will decrease monotonically 10965bd8deadSopenharmony_ci with the value of <n>-<f>, where <f> is the clamped floating-point 10975bd8deadSopenharmony_ci tessellation level. When <n>-<f> is zero, the additional segments will 10985bd8deadSopenharmony_ci have equal length to the other segments. As <n>-<f> approaches 2.0, the 10995bd8deadSopenharmony_ci relative length of the additional segments approaches zero. The two 11005bd8deadSopenharmony_ci additional segments should be placed symmetrically on opposite sides of 11015bd8deadSopenharmony_ci the subdivided edge. The relative location of these two segments is 11025bd8deadSopenharmony_ci undefined, but must be identical for any pair of subdivided edges with 11035bd8deadSopenharmony_ci identical values of <f>. 11045bd8deadSopenharmony_ci 11055bd8deadSopenharmony_ci When the tessellation primitive generator produces triangles (in the 11065bd8deadSopenharmony_ci "triangles" or "quads" modes), the orientation of all triangles can be 11075bd8deadSopenharmony_ci specified by an input layout declaration in the tessellation evaluation 11085bd8deadSopenharmony_ci shader using the identifiers "cw" and "ccw". If the order is "cw", the 11095bd8deadSopenharmony_ci vertices of all generated triangles will have a clockwise ordering in 11105bd8deadSopenharmony_ci (u,v) or (u,v,w) space, as illustrated in Figure 11.X1. If the order is 11115bd8deadSopenharmony_ci "ccw", the vertices will be specified in counter-clockwise order. If no 11125bd8deadSopenharmony_ci layout is specified, "ccw" will be used. 11135bd8deadSopenharmony_ci 11145bd8deadSopenharmony_ci For all primitive modes, the tessellation primitive generator is capable 11155bd8deadSopenharmony_ci of generating points instead of lines or triangles. If an input layout 11165bd8deadSopenharmony_ci declaration in the tessellation evaluation shader specifies the identifier 11175bd8deadSopenharmony_ci "point_mode", the primitive generator will generate one point for each 11185bd8deadSopenharmony_ci distinct vertex produced by tessellation. Otherwise, the primitive 11195bd8deadSopenharmony_ci generator will produce a collection of line segments or triangles 11205bd8deadSopenharmony_ci according to the primitive mode. When tessellating triangles or quads in 11215bd8deadSopenharmony_ci point mode with fractional odd spacing, the tessellation primitive 11225bd8deadSopenharmony_ci generator may produce "interior" vertices that are positioned on the edge 11235bd8deadSopenharmony_ci of the patch if an inner tessellation level is less than or equal to one. 11245bd8deadSopenharmony_ci Such vertices are considered distinct from vertices produced by 11255bd8deadSopenharmony_ci subdividing the outer edge of the patch, even if there are pairs of 11265bd8deadSopenharmony_ci vertices with identical coordinates. 11275bd8deadSopenharmony_ci 11285bd8deadSopenharmony_ci The points, lines, or triangles produced by the tessellation primitive 11295bd8deadSopenharmony_ci generator are passed to subsequent pipeline stages in an 11305bd8deadSopenharmony_ci implementation-dependent order. 11315bd8deadSopenharmony_ci 11325bd8deadSopenharmony_ci 11335bd8deadSopenharmony_ci Section 11.1ts.2.1, Triangle Tessellation 11345bd8deadSopenharmony_ci 11355bd8deadSopenharmony_ci If the tessellation primitive mode is "triangles", an equilateral 11365bd8deadSopenharmony_ci triangle is subdivided into a collection of triangles covering the area 11375bd8deadSopenharmony_ci of the original triangle. First, the original triangle is subdivided 11385bd8deadSopenharmony_ci into a collection of concentric equilateral triangles. The edges of each 11395bd8deadSopenharmony_ci of these triangles are subdivided, and the area between each triangle 11405bd8deadSopenharmony_ci pair is filled by triangles produced by joining the vertices on the 11415bd8deadSopenharmony_ci subdivided edges. The number of concentric triangles and the number of 11425bd8deadSopenharmony_ci subdivisions along each triangle except the outermost is derived from 11435bd8deadSopenharmony_ci the first inner tessellation level. The edges of the outermost triangle 11445bd8deadSopenharmony_ci are subdivided independently, using the first, second, and third outer 11455bd8deadSopenharmony_ci tessellation levels to control the number of subdivisions of the u==0 11465bd8deadSopenharmony_ci (left), v==0 (bottom), and w==0 (right) edges, respectively. The second 11475bd8deadSopenharmony_ci inner tessellation level and the fourth outer tessellation level have no 11485bd8deadSopenharmony_ci effect in this mode. 11495bd8deadSopenharmony_ci 11505bd8deadSopenharmony_ci If the first inner tessellation level and all three outer tessellation 11515bd8deadSopenharmony_ci levels are exactly one after clamping and rounding, only a single 11525bd8deadSopenharmony_ci triangle with (u,v,w) coordinates of (0,0,1), (1,0,0), and (0,1,0) is 11535bd8deadSopenharmony_ci generated. If the inner tessellation level is one and any of the outer 11545bd8deadSopenharmony_ci tessellation levels is greater than one, the inner tessellation level is 11555bd8deadSopenharmony_ci treated as though it were originally specified as 1+epsilon and will be 11565bd8deadSopenharmony_ci rounded up to result in a two- or three-segment subdivision according to 11575bd8deadSopenharmony_ci the tessellation spacing. 11585bd8deadSopenharmony_ci 11595bd8deadSopenharmony_ci If any tessellation level is greater than one, tessellation begins by 11605bd8deadSopenharmony_ci producing a set of concentric inner triangles and subdividing their 11615bd8deadSopenharmony_ci edges. First, the three outer edges are temporarily subdivided using the 11625bd8deadSopenharmony_ci clamped and rounded first inner tessellation level and the specified 11635bd8deadSopenharmony_ci tessellation spacing, generating <n> segments. For the outermost inner 11645bd8deadSopenharmony_ci triangle, the inner triangle is degenerate -- a single point at the 11655bd8deadSopenharmony_ci center of the triangle -- if <n> is two. Otherwise, for each corner of 11665bd8deadSopenharmony_ci the outer triangle, an inner triangle corner is produced at the 11675bd8deadSopenharmony_ci intersection of two lines extended perpendicular to the corner's two 11685bd8deadSopenharmony_ci adjacent edges running through the vertex of the subdivided outer edge 11695bd8deadSopenharmony_ci nearest that corner. If <n> is three, the edges of the inner triangle 11705bd8deadSopenharmony_ci are not subdivided and is the final triangle in the set of concentric 11715bd8deadSopenharmony_ci triangles. Otherwise, each edge of the inner triangle is divided into 11725bd8deadSopenharmony_ci <n>-2 segments, with the <n>-1 vertices of this subdivision produced by 11735bd8deadSopenharmony_ci intersecting the inner edge with lines perpendicular to the edge running 11745bd8deadSopenharmony_ci through the <n>-1 innermost vertices of the subdivision of the outer 11755bd8deadSopenharmony_ci edge. Once the outermost inner triangle is subdivided, the previous 11765bd8deadSopenharmony_ci subdivision process repeats itself, using the generated triangle as an 11775bd8deadSopenharmony_ci outer triangle. This subdivision process is illustrated in Figure 11.X2. 11785bd8deadSopenharmony_ci 11795bd8deadSopenharmony_ci (0,1,0) 11805bd8deadSopenharmony_ci + 11815bd8deadSopenharmony_ci / \ 11825bd8deadSopenharmony_ci (0,1,0) O. .O 11835bd8deadSopenharmony_ci + / + \ 11845bd8deadSopenharmony_ci / \ O. / \ .O 11855bd8deadSopenharmony_ci O. .O / O. .O \ 11865bd8deadSopenharmony_ci / + \ / / + \ \ 11875bd8deadSopenharmony_ci O. / \ .O / / / \ \ \ 11885bd8deadSopenharmony_ci / O. .O \ O. / / \ \ .O 11895bd8deadSopenharmony_ci / / O \ \ / O. / \ .O \ 11905bd8deadSopenharmony_ci O. / . \ .O / / O-------O \ \ 11915bd8deadSopenharmony_ci / O----O----O \ O. / . . \ .O 11925bd8deadSopenharmony_ci / . . . \ / O----O-------O----O \ 11935bd8deadSopenharmony_ci O----O----O----O----O / . . . . \ 11945bd8deadSopenharmony_ci (0,0,1) (1,0,0) O----O----O-------O----O----O 11955bd8deadSopenharmony_ci (0,0,1) (1,0,0) 11965bd8deadSopenharmony_ci 11975bd8deadSopenharmony_ci Figure 11.X2, Inner Triangle Tessellation with inner tessellation 11985bd8deadSopenharmony_ci levels of four and five (not to scale). This figure depicts the 11995bd8deadSopenharmony_ci vertices along the bottom edge of the concentric triangles. The edges 12005bd8deadSopenharmony_ci of inner triangles are subdivided by intersecting the edge with 12015bd8deadSopenharmony_ci segments perpendicular to the edge passing through each inner vertex 12025bd8deadSopenharmony_ci of the subdivided outer edge. 12035bd8deadSopenharmony_ci 12045bd8deadSopenharmony_ci Once all the concentric triangles are produced and their edges are 12055bd8deadSopenharmony_ci subdivided, the area between each pair of adjacent inner triangles is 12065bd8deadSopenharmony_ci filled completely with a set of non-overlapping triangles. In this 12075bd8deadSopenharmony_ci subdivision, two of the three vertices of each triangle are taken from 12085bd8deadSopenharmony_ci adjacent vertices on a subdivided edge of one triangle; the third is one 12095bd8deadSopenharmony_ci of the vertices on the corresponding edge of the other triangle. If the 12105bd8deadSopenharmony_ci innermost triangle is degenerate (i.e., a point), the triangle 12115bd8deadSopenharmony_ci containing it is subdivided into six triangles by connecting each of the 12125bd8deadSopenharmony_ci six vertices on that triangle with the center point. If the innermost 12135bd8deadSopenharmony_ci triangle is not degenerate, that triangle is added to the set of 12145bd8deadSopenharmony_ci generated triangles as-is. 12155bd8deadSopenharmony_ci 12165bd8deadSopenharmony_ci After the area corresponding to any inner triangles is filled, the 12175bd8deadSopenharmony_ci primitive generator generates triangles to cover area between the 12185bd8deadSopenharmony_ci outermost triangle and the outermost inner triangle. To do this, the 12195bd8deadSopenharmony_ci temporary subdivision of the outer triangle edge above is discarded. 12205bd8deadSopenharmony_ci Instead, the u==0, v==0, and w==0 edges are subdivided according to the 12215bd8deadSopenharmony_ci first, second, and third outer tessellation levels, respectively, and 12225bd8deadSopenharmony_ci the tessellation spacing. The original subdivision of the first inner 12235bd8deadSopenharmony_ci triangle is retained. The area between the outer and first inner 12245bd8deadSopenharmony_ci triangles is completely filled by non-overlapping triangles as described 12255bd8deadSopenharmony_ci above. If the first (and only) inner triangle is degenerate, a set of 12265bd8deadSopenharmony_ci triangles is produced by connecting each vertex on the outer triangle 12275bd8deadSopenharmony_ci edges with the center point. 12285bd8deadSopenharmony_ci 12295bd8deadSopenharmony_ci After all triangles are generated, each vertex in the subdivided 12305bd8deadSopenharmony_ci triangle is assigned a barycentric (u,v,w) coordinate based on its 12315bd8deadSopenharmony_ci location relative to the three vertices of the outer triangle. 12325bd8deadSopenharmony_ci 12335bd8deadSopenharmony_ci The algorithm used to subdivide the triangular domain in (u,v,w) space 12345bd8deadSopenharmony_ci into individual triangles is implementation-dependent. However, the set 12355bd8deadSopenharmony_ci of triangles produced will completely cover the domain, and no portion 12365bd8deadSopenharmony_ci of the domain will be covered by multiple triangles. The order in which 12375bd8deadSopenharmony_ci the generated triangles passed to subsequent pipeline stages and the 12385bd8deadSopenharmony_ci order of the vertices in those triangles are both 12395bd8deadSopenharmony_ci implementation-dependent. However, when depicted in a manner similar to 12405bd8deadSopenharmony_ci Figure 11.X2, the order of the vertices in the generated triangles will 12415bd8deadSopenharmony_ci be either all clockwise or all counter-clockwise, according to the 12425bd8deadSopenharmony_ci vertex order layout declaration. 12435bd8deadSopenharmony_ci 12445bd8deadSopenharmony_ci 12455bd8deadSopenharmony_ci Section 11.1ts.2.2, Quad Tessellation 12465bd8deadSopenharmony_ci 12475bd8deadSopenharmony_ci If the tessellation primitive mode is "quads", a rectangle is subdivided 12485bd8deadSopenharmony_ci into a collection of triangles covering the area of the original 12495bd8deadSopenharmony_ci rectangle. First, the original rectangle is subdivided into a regular 12505bd8deadSopenharmony_ci mesh of rectangles, where the number of rectangles along the u==0 and 12515bd8deadSopenharmony_ci u==1 (vertical) and v==0 and v==1 (horizontal) edges are derived from 12525bd8deadSopenharmony_ci the first and second inner tessellation levels, respectively. All 12535bd8deadSopenharmony_ci rectangles, except those adjacent to one of the outer rectangle edges, 12545bd8deadSopenharmony_ci are decomposed into triangle pairs. The outermost rectangle edges are 12555bd8deadSopenharmony_ci subdivided independently, using the first, second, third, and fourth 12565bd8deadSopenharmony_ci outer tessellation levels to control the number of subdivisions of the 12575bd8deadSopenharmony_ci u==0 (left), v==0 (bottom), u==1 (right), and v==1 (top) edges, 12585bd8deadSopenharmony_ci respectively. The area between the inner rectangles of the mesh and the 12595bd8deadSopenharmony_ci outer rectangle edges are filled by triangles produced by joining the 12605bd8deadSopenharmony_ci vertices on the subdivided outer edges to the vertices on the edge of 12615bd8deadSopenharmony_ci the inner rectangle mesh. 12625bd8deadSopenharmony_ci 12635bd8deadSopenharmony_ci If both clamped inner tessellation levels and all four clamped outer 12645bd8deadSopenharmony_ci tessellation levels are exactly one, only a single triangle pair covering 12655bd8deadSopenharmony_ci the outer rectangle is generated. Otherwise, if either clamped inner 12665bd8deadSopenharmony_ci tessellation level is one, that tessellation level is treated as though it 12675bd8deadSopenharmony_ci were originally specified as 1+epsilon and will result in a two- or 12685bd8deadSopenharmony_ci three-segment subdivision depending on the tessellation spacing. When 12695bd8deadSopenharmony_ci used with fractional odd spacing, the three-segment subdivision may 12705bd8deadSopenharmony_ci produce "inner" vertices positioned on the edge of the rectangle. 12715bd8deadSopenharmony_ci 12725bd8deadSopenharmony_ci If any tessellation level is greater than one, tessellation begins by 12735bd8deadSopenharmony_ci subdividing the u==0 and u==1 edges of the outer rectangle into <m> 12745bd8deadSopenharmony_ci segments using the clamped and rounded first inner tessellation level 12755bd8deadSopenharmony_ci and the tessellation spacing. The v==0 and v==1 edges are subdivided 12765bd8deadSopenharmony_ci into <n> segments using using the second inner tessellation level. Each 12775bd8deadSopenharmony_ci vertex on the u==0 and v==0 edges are joined with the corresponding 12785bd8deadSopenharmony_ci vertex on the u==1 and v==1 edges to produce a set of vertical and 12795bd8deadSopenharmony_ci horizontal lines that divide the rectangle into a grid of smaller 12805bd8deadSopenharmony_ci rectangles. The primitive generator emits a pair of non-overlapping 12815bd8deadSopenharmony_ci triangles covering each such rectangle not adjacent to an edge of the 12825bd8deadSopenharmony_ci outer rectangle. The boundary of the region covered by these triangles 12835bd8deadSopenharmony_ci forms an inner rectangle, the edges of which are subdivided by the grid 12845bd8deadSopenharmony_ci vertices that lie on the edge. If either <m> or <n> is two, the inner 12855bd8deadSopenharmony_ci rectangle is degenerate, and one or both of the rectangle's "edges" 12865bd8deadSopenharmony_ci consist of a single point. This subdivision is illustrated in Figure 12875bd8deadSopenharmony_ci 11.X3. 12885bd8deadSopenharmony_ci 12895bd8deadSopenharmony_ci (0,1) (1,1) 12905bd8deadSopenharmony_ci +--+--+--+--+--+--+--+ 12915bd8deadSopenharmony_ci | . . . . . . | 12925bd8deadSopenharmony_ci (0,1) (1,1) | . . . . . . | 12935bd8deadSopenharmony_ci +--+--+--+--+ +..O--O--O--O--O--O..+ 12945bd8deadSopenharmony_ci | . . . | | |**|**|**|**|**| | 12955bd8deadSopenharmony_ci | . . . | | |**|**|**|**|**| | 12965bd8deadSopenharmony_ci +..O--O--O..+ +..O--+--+--+--+--O..+ 12975bd8deadSopenharmony_ci | . . . | | |**|**|**|**|**| | 12985bd8deadSopenharmony_ci | . . . | | |**|**|**|**|**| | 12995bd8deadSopenharmony_ci +--+--+--+--+ +..O--O--O--O--O--O..+ 13005bd8deadSopenharmony_ci (0,0) (1,0) | . . . . . . | 13015bd8deadSopenharmony_ci | . . . . . . | 13025bd8deadSopenharmony_ci +--+--+--+--+--+--+--+ 13035bd8deadSopenharmony_ci (0,0) (1,0) 13045bd8deadSopenharmony_ci 13055bd8deadSopenharmony_ci Figure 11.X3, Inner Quad Tessellation with inner tessellation levels 13065bd8deadSopenharmony_ci of (4,2) and (7,4). The areas labeled with "*" on the right depict the 13075bd8deadSopenharmony_ci 10 inner rectangles, each of which will be subdivided into two 13085bd8deadSopenharmony_ci triangles. The points labeled "O" depict vertices on the boundary of 13095bd8deadSopenharmony_ci the inner rectangle, where the inner rectangle on the left side is 13105bd8deadSopenharmony_ci degenerate (a single line segment). The dotted lines (".") depict the 13115bd8deadSopenharmony_ci horizontal and vertical edges connecting corresponding points on the 13125bd8deadSopenharmony_ci outer rectangle edge. 13135bd8deadSopenharmony_ci 13145bd8deadSopenharmony_ci After the area corresponding to the inner rectangle is filled, the 13155bd8deadSopenharmony_ci primitive generator must produce triangles to cover area between the 13165bd8deadSopenharmony_ci inner and outer rectangles. To do this, the subdivision of the outer 13175bd8deadSopenharmony_ci rectangle edge above is discarded. Instead, the u==0, v==0, u==1, and 13185bd8deadSopenharmony_ci v==1 edges are subdivided according to the first, second, third, and 13195bd8deadSopenharmony_ci fourth outer tessellation levels, respectively, and the tessellation 13205bd8deadSopenharmony_ci spacing. The original subdivision of the inner rectangle is retained. 13215bd8deadSopenharmony_ci The area between the outer and inner rectangles is completely filled by 13225bd8deadSopenharmony_ci non-overlapping triangles. Two of the three vertices of each triangle 13235bd8deadSopenharmony_ci are adjacent vertices on a subdivided edge of one rectangle; the third 13245bd8deadSopenharmony_ci is one of the vertices on the corresponding edge of the other triangle. 13255bd8deadSopenharmony_ci If either edge of the innermost rectangle is degenerate, the area near 13265bd8deadSopenharmony_ci the corresponding outer edges is filled by connecting each vertex on the 13275bd8deadSopenharmony_ci outer edge with the single vertex making up the inner "edge". 13285bd8deadSopenharmony_ci 13295bd8deadSopenharmony_ci The algorithm used to subdivide the rectangular domain in (u,v) space 13305bd8deadSopenharmony_ci into individual triangles is implementation-dependent. However, the set 13315bd8deadSopenharmony_ci of triangles produced will completely cover the domain, and no portion 13325bd8deadSopenharmony_ci of the domain will be covered by multiple triangles. The order in which 13335bd8deadSopenharmony_ci the generated triangles passed to subsequent pipeline stages and the 13345bd8deadSopenharmony_ci order of the vertices in those triangles are both 13355bd8deadSopenharmony_ci implementation-dependent. However, when depicted in a manner similar to 13365bd8deadSopenharmony_ci Figure 11.X3, the order of the vertices in the generated triangles will 13375bd8deadSopenharmony_ci be either all clockwise or all counter-clockwise, according to the 13385bd8deadSopenharmony_ci vertex order layout declaration. 13395bd8deadSopenharmony_ci 13405bd8deadSopenharmony_ci 13415bd8deadSopenharmony_ci Isoline Tessellation 13425bd8deadSopenharmony_ci 13435bd8deadSopenharmony_ci If the tessellation primitive mode is "isolines", a set of independent 13445bd8deadSopenharmony_ci horizontal line segments is drawn. The segments are arranged into 13455bd8deadSopenharmony_ci connected strips called "isolines", where the vertices of each isoline 13465bd8deadSopenharmony_ci have a constant v coordinate and u coordinates covering the full range 13475bd8deadSopenharmony_ci [0,1]. The number of isolines generated is derived from the first outer 13485bd8deadSopenharmony_ci tessellation level; the number of segments in each isoline is derived 13495bd8deadSopenharmony_ci from the second outer tessellation level. Both inner tessellation levels 13505bd8deadSopenharmony_ci and the third and fourth outer tessellation levels have no effect in 13515bd8deadSopenharmony_ci this mode. 13525bd8deadSopenharmony_ci 13535bd8deadSopenharmony_ci As with quad tessellation above, isoline tessellation begins with a 13545bd8deadSopenharmony_ci rectangle. The u==0 and u==1 edges of the rectangle are subdivided 13555bd8deadSopenharmony_ci according to the first outer tessellation level. For the purposes of 13565bd8deadSopenharmony_ci this subdivision, the tessellation spacing mode is ignored and treated 13575bd8deadSopenharmony_ci as "equal_spacing". A line is drawn connecting each vertex on the u==0 13585bd8deadSopenharmony_ci rectangle edge to the corresponding vertex on the u==1 rectangle edge, 13595bd8deadSopenharmony_ci except that no line is drawn between (0,1) and (1,1). If the number of 13605bd8deadSopenharmony_ci segments on the subdivided u==0 and u==1 edges is <n>, this process will 13615bd8deadSopenharmony_ci result in <n> equally spaced lines with constant v coordinates of 0, 13625bd8deadSopenharmony_ci 1/<n>, 2/<n>, ..., (<n>-1)/<n>. 13635bd8deadSopenharmony_ci 13645bd8deadSopenharmony_ci Each of the <n> lines is then subdivided according to the second outer 13655bd8deadSopenharmony_ci tessellation level and the tessellation spacing, resulting in <m> line 13665bd8deadSopenharmony_ci segments. Each segment of each line is emitted by the tessellation 13675bd8deadSopenharmony_ci primitive generator, as illustrated in Figure 11.X4. 13685bd8deadSopenharmony_ci 13695bd8deadSopenharmony_ci (0,1) (1,1) 13705bd8deadSopenharmony_ci + + (0,1) (1,1) 13715bd8deadSopenharmony_ci + + 13725bd8deadSopenharmony_ci O---O---O---O---O---O---O 13735bd8deadSopenharmony_ci 13745bd8deadSopenharmony_ci O---O---O---O---O---O---O 13755bd8deadSopenharmony_ci 13765bd8deadSopenharmony_ci O---O---O---O---O---O---O 13775bd8deadSopenharmony_ci O-----O-----O-----O 13785bd8deadSopenharmony_ci O---O---O---O---O---O---O (0,0) (1,0) 13795bd8deadSopenharmony_ci (0,0) (1,0) 13805bd8deadSopenharmony_ci 13815bd8deadSopenharmony_ci Figure 11.X4, Isoline Tessellation with the first two outer 13825bd8deadSopenharmony_ci tessellation levels of (4,6) and (1,3), respectively. The lines 13835bd8deadSopenharmony_ci connecting the vertices labeled "O" are emitted by the primitive 13845bd8deadSopenharmony_ci generator. The vertices labeled "+" correspond to (u,v) coordinates of 13855bd8deadSopenharmony_ci (0,1) and (1,1), where no line segments are generated. 13865bd8deadSopenharmony_ci 13875bd8deadSopenharmony_ci The order in which the generated line segments are passed to subsequent 13885bd8deadSopenharmony_ci pipeline stages and the order of the vertices in each generated line 13895bd8deadSopenharmony_ci segment are both implementation-dependent. 13905bd8deadSopenharmony_ci 13915bd8deadSopenharmony_ci 13925bd8deadSopenharmony_ci Section 11.1ts.3, Tessellation Evaluation Shaders 13935bd8deadSopenharmony_ci 13945bd8deadSopenharmony_ci If active, the tessellation evaluation shader takes the (u,v) or (u,v,w) 13955bd8deadSopenharmony_ci location of each vertex in the primitive subdivided by the tessellation 13965bd8deadSopenharmony_ci primitive generator, and generates a vertex with a position and 13975bd8deadSopenharmony_ci associated attributes. The tessellation evaluation shader can read any 13985bd8deadSopenharmony_ci of the vertices of its input patch, which is the output patch produced 13995bd8deadSopenharmony_ci by the tessellation control shader. Tessellation evaluation shaders are 14005bd8deadSopenharmony_ci created as described in section 7.1, using a <type> of 14015bd8deadSopenharmony_ci TESS_EVALUATION_SHADER_EXT. 14025bd8deadSopenharmony_ci 14035bd8deadSopenharmony_ci Each invocation of the tessellation evaluation shader writes the 14045bd8deadSopenharmony_ci attributes of exactly one vertex. The number of vertices evaluated per 14055bd8deadSopenharmony_ci patch depends on the tessellation level values computed by the 14065bd8deadSopenharmony_ci tessellation control shaders. Tessellation evaluation shader invocations 14075bd8deadSopenharmony_ci run independently, and no invocation can access the variables belonging 14085bd8deadSopenharmony_ci to another invocation. All invocations are capable of accessing all the 14095bd8deadSopenharmony_ci vertices of their corresponding input patch. 14105bd8deadSopenharmony_ci 14115bd8deadSopenharmony_ci The number of the vertices in the input patch is fixed and is equal to 14125bd8deadSopenharmony_ci the tessellation control shader output patch size parameter in effect 14135bd8deadSopenharmony_ci when the program was last linked. 14145bd8deadSopenharmony_ci 14155bd8deadSopenharmony_ci 14165bd8deadSopenharmony_ci Section 11.1ts.3.1, Tessellation Evaluation Shader Variables 14175bd8deadSopenharmony_ci 14185bd8deadSopenharmony_ci Tessellation evaluation shaders can access uniforms belonging to the 14195bd8deadSopenharmony_ci current program object. The amount of storage available for uniform 14205bd8deadSopenharmony_ci variables, except for atomic counters, in the default uniform block 14215bd8deadSopenharmony_ci accessed by a tessellation evaluation shader is specified by the value 14225bd8deadSopenharmony_ci of the implementation-dependent constant 14235bd8deadSopenharmony_ci MAX_TESS_EVALUATION_UNIFORM_COMPONENTS_EXT. The total amount of combined 14245bd8deadSopenharmony_ci storage available for uniform variables in all uniform blocks accessed 14255bd8deadSopenharmony_ci by a tessellation evaluation shader (including the default uniform 14265bd8deadSopenharmony_ci block) is specified by the value of the implementation-dependent 14275bd8deadSopenharmony_ci constant MAX_COMBINED_TESS_EVALUATION_UNIFORM_COMPONENTS_EXT. These 14285bd8deadSopenharmony_ci values represent the numbers of individual floating-point, integer, or 14295bd8deadSopenharmony_ci boolean values that can be held in uniform variable storage for a 14305bd8deadSopenharmony_ci tessellation evaluation shader. A uniform matrix in the default uniform 14315bd8deadSopenharmony_ci block with single-precision components will consume no more than 4 x 14325bd8deadSopenharmony_ci min(r,c) uniform components. A link error is generated if an attempt is 14335bd8deadSopenharmony_ci made to utilize more than the space available for tessellation 14345bd8deadSopenharmony_ci evaluation shader uniform variables. Uniforms are manipulated as 14355bd8deadSopenharmony_ci described in section 2.11.6. Tessellation evaluation shaders also have 14365bd8deadSopenharmony_ci access to samplers to perform texturing operations, as described in 14375bd8deadSopenharmony_ci section 2.11.7. 14385bd8deadSopenharmony_ci 14395bd8deadSopenharmony_ci Tessellation evaluation shaders can access the transformed attributes of 14405bd8deadSopenharmony_ci all vertices for their input primitive using input variables. A 14415bd8deadSopenharmony_ci tessellation control shader writing to output variables generates the 14425bd8deadSopenharmony_ci values of these input varying variables, including values for built-in 14435bd8deadSopenharmony_ci as well as user- defined varying variables. Values for any varying 14445bd8deadSopenharmony_ci variables that are not written by a tessellation control shader are 14455bd8deadSopenharmony_ci undefined. 14465bd8deadSopenharmony_ci 14475bd8deadSopenharmony_ci Additionally, tessellation evaluation shaders can write to one or more 14485bd8deadSopenharmony_ci output variables that will be passed to subsequent programmable shader 14495bd8deadSopenharmony_ci stages or fixed functionality vertex pipeline stages. 14505bd8deadSopenharmony_ci 14515bd8deadSopenharmony_ci 14525bd8deadSopenharmony_ci Section 11.1ts.3.2, Tessellation Evaluation Shader Execution Environment 14535bd8deadSopenharmony_ci 14545bd8deadSopenharmony_ci If there is an active program for the tessellation evaluation stage, the 14555bd8deadSopenharmony_ci executable version of the program's tessellation evaluation shader is 14565bd8deadSopenharmony_ci used to process vertices produced by the tessellation primitive 14575bd8deadSopenharmony_ci generator. During this processing, the shader may access the input patch 14585bd8deadSopenharmony_ci processed by the primitive generator. When tessellation evaluation 14595bd8deadSopenharmony_ci shader execution completes, a new vertex is assembled from the output 14605bd8deadSopenharmony_ci variables written by the shader and is passed to subsequent pipeline 14615bd8deadSopenharmony_ci stages. 14625bd8deadSopenharmony_ci 14635bd8deadSopenharmony_ci There are several special considerations for tessellation evaluation 14645bd8deadSopenharmony_ci shader execution described in the following sections. 14655bd8deadSopenharmony_ci 14665bd8deadSopenharmony_ci 14675bd8deadSopenharmony_ci Section 11.1ts.3.2.1, Texture Access 14685bd8deadSopenharmony_ci 14695bd8deadSopenharmony_ci Section 11.1.3.1 describes texture lookup functionality accessible to a 14705bd8deadSopenharmony_ci vertex shader. The texel fetch and texture size query functionality 14715bd8deadSopenharmony_ci described there also applies to tessellation evaluation shaders. 14725bd8deadSopenharmony_ci 14735bd8deadSopenharmony_ci 14745bd8deadSopenharmony_ci Section 11.1ts.3.3, Tessellation Evaluation Shader Inputs 14755bd8deadSopenharmony_ci 14765bd8deadSopenharmony_ci Section 7.1 ("Built-In Variables") of the OpenGL ES Shading Language 14775bd8deadSopenharmony_ci Specification describes the built-in variable array gl_in[] available as 14785bd8deadSopenharmony_ci input to a tessellation evaluation shader. gl_in[] receives values from 14795bd8deadSopenharmony_ci equivalent built-in output variables written by a previous shader 14805bd8deadSopenharmony_ci (section 11.1.3). Each array element of gl_in[] is a structure holding 14815bd8deadSopenharmony_ci values for a specific vertex of the input patch. The length of gl_in[] 14825bd8deadSopenharmony_ci is equal to the implementation- dependent maximum patch size 14835bd8deadSopenharmony_ci (gl_MaxPatchVertices). Behavior is undefined if gl_in[] is indexed with 14845bd8deadSopenharmony_ci a vertex index greater than or equal to the current patch size. The 14855bd8deadSopenharmony_ci members of each element of the gl_in[] array are gl_Position 14865bd8deadSopenharmony_ci [[ If EXT_tessellation_point_size is supported: ]] 14875bd8deadSopenharmony_ci and gl_PointSize. 14885bd8deadSopenharmony_ci 14895bd8deadSopenharmony_ci Tessellation evaluation shaders have available several other special 14905bd8deadSopenharmony_ci input variables not replicated per-vertex and not contained in gl_in[], 14915bd8deadSopenharmony_ci including: 14925bd8deadSopenharmony_ci 14935bd8deadSopenharmony_ci * The variables gl_PatchVerticesIn and gl_PrimitiveID are filled with 14945bd8deadSopenharmony_ci the number of the vertices in the input patch and a primitive 14955bd8deadSopenharmony_ci number, respectively. They behave exactly as the identically named 14965bd8deadSopenharmony_ci inputs for tessellation control shaders. 14975bd8deadSopenharmony_ci 14985bd8deadSopenharmony_ci * The variable gl_TessCoord is a three-component floating-point vector 14995bd8deadSopenharmony_ci consisting of the (u,v,w) coordinate of the vertex being processed 15005bd8deadSopenharmony_ci by the tessellation evaluation shader. The values of u, v, and w are 15015bd8deadSopenharmony_ci in the range [0,1], and vary linearly across the primitive being 15025bd8deadSopenharmony_ci subdivided. For tessellation primitive modes of "quads" or 15035bd8deadSopenharmony_ci "isolines", the w value is always zero. The (u,v,w) coordinates are 15045bd8deadSopenharmony_ci generated by the tessellation primitive generator in a manner 15055bd8deadSopenharmony_ci dependent on the primitive mode, as described in section 11.1ts.2. 15065bd8deadSopenharmony_ci gl_TessCoord is not an array; it specifies the location of the 15075bd8deadSopenharmony_ci vertex being processed by the tessellation evaluation shader, not of 15085bd8deadSopenharmony_ci any vertex in the input patch. 15095bd8deadSopenharmony_ci 15105bd8deadSopenharmony_ci * The variables gl_TessLevelOuter[] and gl_TessLevelInner[] are arrays 15115bd8deadSopenharmony_ci holding outer and inner tessellation levels of the patch, as used by 15125bd8deadSopenharmony_ci the tessellation primitive generator. Tessellation level values 15135bd8deadSopenharmony_ci loaded in these variables will be prior to the clamping and rounding 15145bd8deadSopenharmony_ci operations performed by the primitive generator as described in 15155bd8deadSopenharmony_ci Section 11.1ts.2. For triangular tessellation, gl_TessLevelOuter[3] 15165bd8deadSopenharmony_ci and gl_TessLevelInner[1] will be undefined. For isoline 15175bd8deadSopenharmony_ci tessellation, gl_TessLevelOuter[2], gl_TessLevelOuter[3], and both 15185bd8deadSopenharmony_ci values in gl_TessLevelInner[] are undefined. 15195bd8deadSopenharmony_ci 15205bd8deadSopenharmony_ci A tessellation evaluation shader may also declare user-defined 15215bd8deadSopenharmony_ci per-vertex input variables. User-defined per-vertex input variables are 15225bd8deadSopenharmony_ci declared with the qualifier "in" and have a value for each vertex in the 15235bd8deadSopenharmony_ci input patch. User-defined per-vertex input varying variables have a 15245bd8deadSopenharmony_ci value for each vertex and thus need to be declared as arrays or inside 15255bd8deadSopenharmony_ci input blocks declared as arrays. Declaring an array size is optional. If 15265bd8deadSopenharmony_ci no size is specified, it will be taken from the implementation-dependent 15275bd8deadSopenharmony_ci maximum patch size (gl_MaxPatchVertices). If a size is specified, it must 15285bd8deadSopenharmony_ci match the maximum patch size; otherwise, a compile or link error will 15295bd8deadSopenharmony_ci occur. Since the array size may be larger than the number of vertices 15305bd8deadSopenharmony_ci found in the input patch, behavior is undefined if a per-vertex input 15315bd8deadSopenharmony_ci variable is accessed using an index greater than or equal to the number of 15325bd8deadSopenharmony_ci vertices in the input patch. The OpenGL ES Shading Language doesn't 15335bd8deadSopenharmony_ci support multi-dimensional arrays as shader inputs or outputs; therefore, 15345bd8deadSopenharmony_ci user-defined tessellation evaluation shader inputs corresponding to 15355bd8deadSopenharmony_ci shader outputs declared as arrays must be declared as array members of 15365bd8deadSopenharmony_ci an input block that is itself declared as an array. 15375bd8deadSopenharmony_ci 15385bd8deadSopenharmony_ci Additionally, a tessellation evaluation shader may declare per-patch 15395bd8deadSopenharmony_ci input variables using the qualifier "patch in". Unlike per-vertex 15405bd8deadSopenharmony_ci inputs, per-patch inputs do not correspond to any specific vertex in the 15415bd8deadSopenharmony_ci patch, and are not indexed by vertex number. Per-patch inputs declared 15425bd8deadSopenharmony_ci as arrays have multiple values for the input patch; similarly declared 15435bd8deadSopenharmony_ci per-vertex inputs would indicate a single value for each vertex in the 15445bd8deadSopenharmony_ci output patch. User-defined per-patch input variables are filled with 15455bd8deadSopenharmony_ci corresponding per-patch output values written by the tessellation 15465bd8deadSopenharmony_ci control shader. 15475bd8deadSopenharmony_ci 15485bd8deadSopenharmony_ci Similarly to the limit on vertex shader output components (see section 15495bd8deadSopenharmony_ci 11.1.2.1), there is a limit on the number of components of per-vertex 15505bd8deadSopenharmony_ci and per-patch input variables that can be read by the tessellation 15515bd8deadSopenharmony_ci evaluation shader, given by the values of the implementation-dependent 15525bd8deadSopenharmony_ci constants MAX_TESS_EVALUATION_INPUT_COMPONENTS_EXT and 15535bd8deadSopenharmony_ci MAX_TESS_PATCH_COMPONENTS_EXT, respectively. The built-in inputs 15545bd8deadSopenharmony_ci gl_TessLevelOuter[] and gl_TessLevelInner[] are not counted against the 15555bd8deadSopenharmony_ci per-patch limit. 15565bd8deadSopenharmony_ci 15575bd8deadSopenharmony_ci When a program is linked, all components of any input variable read by a 15585bd8deadSopenharmony_ci tessellation evaluation shader will count against this limit. A program 15595bd8deadSopenharmony_ci whose tessellation evaluation shader exceeds this limit may fail to 15605bd8deadSopenharmony_ci link, unless device-dependent optimizations are able to make the program 15615bd8deadSopenharmony_ci fit within available hardware resources. 15625bd8deadSopenharmony_ci 15635bd8deadSopenharmony_ci Component counting rules for different variable types and variable 15645bd8deadSopenharmony_ci declarations are the same as for MAX_VERTEX_OUTPUT_COMPONENTS (see 15655bd8deadSopenharmony_ci section 11.1.2.1). 15665bd8deadSopenharmony_ci 15675bd8deadSopenharmony_ci 15685bd8deadSopenharmony_ci Section 11.1ts.3.4, Tessellation Evaluation Shader Outputs 15695bd8deadSopenharmony_ci 15705bd8deadSopenharmony_ci Tessellation evaluation shaders have a number of built-in output 15715bd8deadSopenharmony_ci variables used to pass values to equivalent built-in input variables 15725bd8deadSopenharmony_ci read by subsequent shader stages or to subsequent fixed functionality 15735bd8deadSopenharmony_ci vertex processing pipeline stages. These variables are gl_Position 15745bd8deadSopenharmony_ci [[ If EXT_tessellation_point_size is supported: ]] 15755bd8deadSopenharmony_ci and gl_PointSize, 15765bd8deadSopenharmony_ci and behave identically to equivalently named vertex shader outputs (see 15775bd8deadSopenharmony_ci section 11.1.3). A tessellation evaluation shader may also declare 15785bd8deadSopenharmony_ci user-defined per-vertex output variables. 15795bd8deadSopenharmony_ci 15805bd8deadSopenharmony_ci Similarly to the limit on vertex shader output components (see section 15815bd8deadSopenharmony_ci 11.1.2.1), there is a limit on the number of components of built-in and 15825bd8deadSopenharmony_ci user-defined output variables that can be written by the tessellation 15835bd8deadSopenharmony_ci evaluation shader, given by the values of the implementation-dependent 15845bd8deadSopenharmony_ci constant MAX_TESS_EVALUATION_OUTPUT_COMPONENTS_EXT. 15855bd8deadSopenharmony_ci 15865bd8deadSopenharmony_ci When a program is linked, all components of any output variable written 15875bd8deadSopenharmony_ci by a tessellation evaluation shader will count against this limit. A 15885bd8deadSopenharmony_ci program whose tessellation evaluation shader exceeds this limit may fail 15895bd8deadSopenharmony_ci to link, unless device-dependent optimizations are able to make the 15905bd8deadSopenharmony_ci program fit within available hardware resources. 15915bd8deadSopenharmony_ci 15925bd8deadSopenharmony_ci Component counting rules for different variable types and variable 15935bd8deadSopenharmony_ci declarations are the same as for MAX_VERTEX_OUTPUT_COMPONENTS. (see 15945bd8deadSopenharmony_ci section 11.1.2.1). 15955bd8deadSopenharmony_ci 15965bd8deadSopenharmony_ci 15975bd8deadSopenharmony_ci Modify section 12.1, "Transform Feedback" 15985bd8deadSopenharmony_ci 15995bd8deadSopenharmony_ci Replace the second paragraph of the section on p. 274 (as modified 16005bd8deadSopenharmony_ci by EXT_geometry_shader): 16015bd8deadSopenharmony_ci 16025bd8deadSopenharmony_ci The data captured in transform feedback mode depends on the active 16035bd8deadSopenharmony_ci programs on each of the shader stages. If a program is active for the 16045bd8deadSopenharmony_ci geometry shader stage, transform feedback captures the vertices of each 16055bd8deadSopenharmony_ci primitive emitted by the geometry shader. Otherwise, if a program is 16065bd8deadSopenharmony_ci active for the tessellation evaluation shader stage, transform feedback 16075bd8deadSopenharmony_ci captures each primitive produced by the tessellation primitive generator, 16085bd8deadSopenharmony_ci whose vertices are processed by the tessellation evaluation shader. 16095bd8deadSopenharmony_ci Otherwise, transform feedback captures each primitive processed by the 16105bd8deadSopenharmony_ci vertex shader. 16115bd8deadSopenharmony_ci 16125bd8deadSopenharmony_ci Modify the second paragraph following ResumeTransformFeedback on p. 277 16135bd8deadSopenharmony_ci (as modified by EXT_geometry_shader): 16145bd8deadSopenharmony_ci 16155bd8deadSopenharmony_ci When transform feedback is active and not paused ... If a tessellation 16165bd8deadSopenharmony_ci evaluation or geometry shader is active, the type of primitive emitted 16175bd8deadSopenharmony_ci by that shader is used instead of the <mode> parameter passed to drawing 16185bd8deadSopenharmony_ci commands for the purposes of this error check. If tessellation 16195bd8deadSopenharmony_ci evaluation and geometry shaders are both active, the output primitive 16205bd8deadSopenharmony_ci type of the geometry shader will be used for the purposes of this error. 16215bd8deadSopenharmony_ci Any primitive type may be used while transform feedback is paused. 16225bd8deadSopenharmony_ci 16235bd8deadSopenharmony_ci 16245bd8deadSopenharmony_ci Modify the second paragraph of section 12.2, "Primitive Queries" on p. 16255bd8deadSopenharmony_ci 281: 16265bd8deadSopenharmony_ci 16275bd8deadSopenharmony_ci When BeginQuery is called with a target of PRIMITIVES_GENERATED_EXT, ... 16285bd8deadSopenharmony_ci This counter counts the number of primitives emitted by a geometry 16295bd8deadSopenharmony_ci shader, if active, possibly further tessellated into separate primitives 16305bd8deadSopenharmony_ci during the transform feedback stage, if active. 16315bd8deadSopenharmony_ci 16325bd8deadSopenharmony_ci 16335bd8deadSopenharmony_ci Modify section 13.3, "Points" 16345bd8deadSopenharmony_ci 16355bd8deadSopenharmony_ci Replace the text starting "The point size is determined ..." on p. 290: 16365bd8deadSopenharmony_ci 16375bd8deadSopenharmony_ci The point size is determined by the last active stage before the 16385bd8deadSopenharmony_ci rasterizer: 16395bd8deadSopenharmony_ci 16405bd8deadSopenharmony_ci * the geometry shader, if active; or 16415bd8deadSopenharmony_ci * the tessellation evaluation shader, if active and no geometry shader 16425bd8deadSopenharmony_ci is active; 16435bd8deadSopenharmony_ci * the vertex shader, otherwise. 16445bd8deadSopenharmony_ci 16455bd8deadSopenharmony_ci If the last active stage is not a vertex shader and does not statically 16465bd8deadSopenharmony_ci assign a value to gl_PointSize, the point size is 1.0. Otherwise, the 16475bd8deadSopenharmony_ci point size is taken from the shader built-in gl_PointSize written by 16485bd8deadSopenharmony_ci that stage. 16495bd8deadSopenharmony_ci [[ Note that it is impossible to assign a value to gl_PointSize 16505bd8deadSopenharmony_ci if EXT_geometry_point_size or EXT_tessellation_point_size is not 16515bd8deadSopenharmony_ci supported and enabled in the relevant shader stages. ]] 16525bd8deadSopenharmony_ci 16535bd8deadSopenharmony_ci If the last active stage is a vertex shader, the point size is taken 16545bd8deadSopenharmony_ci from the shader built-in gl_PointSize written by the vertex shader. 16555bd8deadSopenharmony_ci 16565bd8deadSopenharmony_ci In all cases, the point size is clamped to the implementation-dependent 16575bd8deadSopenharmony_ci point size range. If the value written to gl_PointSize is less than or 16585bd8deadSopenharmony_ci equal to zero, or if no value is written to gl_PointSize (except as 16595bd8deadSopenharmony_ci noted above) the point size is undefined. The supported range ... 16605bd8deadSopenharmony_ci 16615bd8deadSopenharmony_ci 16625bd8deadSopenharmony_ci Add new section A.3ts in Appendix A before section A.4, "Atomic Counter 16635bd8deadSopenharmony_ci Invariance" on p. 405: 16645bd8deadSopenharmony_ci 16655bd8deadSopenharmony_ci Section A.3ts, Tessellation Invariance 16665bd8deadSopenharmony_ci 16675bd8deadSopenharmony_ci When using a program containing tessellation evaluation shaders, the 16685bd8deadSopenharmony_ci fixed-function tessellation primitive generator consumes the input patch 16695bd8deadSopenharmony_ci specified by an application and emits a new set of primitives. The 16705bd8deadSopenharmony_ci following invariance rules are intended to provide repeatability 16715bd8deadSopenharmony_ci guarantees. Additionally, they are intended to allow an application with 16725bd8deadSopenharmony_ci a carefully crafted tessellation evaluation shader to ensure that the 16735bd8deadSopenharmony_ci sets of triangles generated for two adjacent patches have identical 16745bd8deadSopenharmony_ci vertices along shared patch edges, avoiding "cracks" caused by minor 16755bd8deadSopenharmony_ci differences in the positions of vertices along shared edges. 16765bd8deadSopenharmony_ci 16775bd8deadSopenharmony_ci Rule 1: When processing two patches with identical outer and inner 16785bd8deadSopenharmony_ci tessellation levels, the tessellation primitive generator will emit an 16795bd8deadSopenharmony_ci identical set of point, line, or triangle primitives as long as the 16805bd8deadSopenharmony_ci active program used to process the patch primitives has tessellation 16815bd8deadSopenharmony_ci evaluation shaders specifying the same tessellation mode, spacing, 16825bd8deadSopenharmony_ci vertex order, and point mode input layout qualifiers. Two sets of 16835bd8deadSopenharmony_ci primitives are considered identical if and only if they contain the same 16845bd8deadSopenharmony_ci number and type of primitives and the generated tessellation coordinates 16855bd8deadSopenharmony_ci for the vertex numbered <m> of the primitive numbered <n> are identical 16865bd8deadSopenharmony_ci for all values of <m> and <n>. 16875bd8deadSopenharmony_ci 16885bd8deadSopenharmony_ci Rule 2: The set of vertices generated along the outer edge of the 16895bd8deadSopenharmony_ci subdivided primitive in triangle and quad tessellation, and the 16905bd8deadSopenharmony_ci tessellation coordinates of each, depends only on the corresponding 16915bd8deadSopenharmony_ci outer tessellation level and the spacing input layout qualifier in the 16925bd8deadSopenharmony_ci tessellation evaluation shader of the active program. 16935bd8deadSopenharmony_ci 16945bd8deadSopenharmony_ci Rule 3: The set of vertices generated when subdividing any outer 16955bd8deadSopenharmony_ci primitive edge is always symmetric. For triangle tessellation, if the 16965bd8deadSopenharmony_ci subdivision generates a vertex with tessellation coordinates of the form 16975bd8deadSopenharmony_ci (0,x,1-x), (x,0,1-x), or (x,1-x,0), it will also generate a vertex with 16985bd8deadSopenharmony_ci coordinates of exactly (0,1-x,x), (1-x,0,x), or (1-x,x,0), respectively. 16995bd8deadSopenharmony_ci For quad tessellation, if the subdivision generates a vertex with 17005bd8deadSopenharmony_ci coordinates of (x,0) or (0,x), it will also generate a vertex with 17015bd8deadSopenharmony_ci coordinates of exactly (1-x,0) or (0,1-x), respectively. For isoline 17025bd8deadSopenharmony_ci tessellation, if it generates vertices at (0,x) and (1,x) where <x> is 17035bd8deadSopenharmony_ci not zero, it will also generate vertices at exactly (0,1-x) and (1,1-x), 17045bd8deadSopenharmony_ci respectively. 17055bd8deadSopenharmony_ci 17065bd8deadSopenharmony_ci Rule 4: The set of vertices generated when subdividing outer edges in 17075bd8deadSopenharmony_ci triangular and quad tessellation must be independent of the specific 17085bd8deadSopenharmony_ci edge subdivided, given identical outer tessellation levels and spacing. 17095bd8deadSopenharmony_ci For example, if vertices at (x,1-x,0) and (1-x,x,0) are generated when 17105bd8deadSopenharmony_ci subdividing the w==0 edge in triangular tessellation, vertices must be 17115bd8deadSopenharmony_ci generated at (x,0,1-x) and (1-x,0,x) when subdividing an otherwise 17125bd8deadSopenharmony_ci identical v==0 edge. For quad tessellation, if vertices at (x,0) and 17135bd8deadSopenharmony_ci (1-x,0) are generated when subdividing the v==0 edge, vertices must be 17145bd8deadSopenharmony_ci generated at (0,x) and (0,1-x) when subdividing an otherwise identical 17155bd8deadSopenharmony_ci u==0 edge. 17165bd8deadSopenharmony_ci 17175bd8deadSopenharmony_ci Rule 5: When processing two patches that are identical in all respects 17185bd8deadSopenharmony_ci enumerated in rule 1 except for vertex order, the set of triangles 17195bd8deadSopenharmony_ci generated for triangle and quad tessellation must be identical except 17205bd8deadSopenharmony_ci for vertex and triangle order. For each triangle <n1> produced by 17215bd8deadSopenharmony_ci processing the first patch, there must be a triangle <n2> produced when 17225bd8deadSopenharmony_ci processing the second patch each of whose vertices has the same 17235bd8deadSopenharmony_ci tessellation coordinates as one of the vertices in <n1>. 17245bd8deadSopenharmony_ci 17255bd8deadSopenharmony_ci Rule 6: When processing two patches that are identical in all respects 17265bd8deadSopenharmony_ci enumerated in rule 1 other than matching outer tessellation levels 17275bd8deadSopenharmony_ci and/or vertex order, the set of interior triangles generated for 17285bd8deadSopenharmony_ci triangle and quad tessellation must be identical in all respects except 17295bd8deadSopenharmony_ci for vertex and triangle order. For each interior triangle <n1> produced 17305bd8deadSopenharmony_ci by processing the first patch, there must be a triangle <n2> produced 17315bd8deadSopenharmony_ci when processing the second patch each of whose vertices has the same 17325bd8deadSopenharmony_ci tessellation coordinates as one of the vertices in <n1>. A triangle 17335bd8deadSopenharmony_ci produced by the tessellator is considered an interior triangle if none 17345bd8deadSopenharmony_ci of its vertices lie on an outer edge of the subdivided primitive. 17355bd8deadSopenharmony_ci 17365bd8deadSopenharmony_ci Rule 7: For quad and triangle tessellation, the set of triangles 17375bd8deadSopenharmony_ci connecting an inner and outer edge depends only on the inner and outer 17385bd8deadSopenharmony_ci tessellation levels corresponding to that edge and the spacing input 17395bd8deadSopenharmony_ci layout qualifier. 17405bd8deadSopenharmony_ci 17415bd8deadSopenharmony_ci Rule 8: The value of all defined components of gl_TessCoord will be in 17425bd8deadSopenharmony_ci the range [0,1]. Additionally, for any defined component <x> of 17435bd8deadSopenharmony_ci gl_TessCoord, the results of computing (1.0-<x>) in a tessellation 17445bd8deadSopenharmony_ci evaluation shader will be exact. Some floating-point values in the range 17455bd8deadSopenharmony_ci [0,1] may fail to satisfy this property, but such values may never be 17465bd8deadSopenharmony_ci used as tessellation coordinate components. 17475bd8deadSopenharmony_ci 17485bd8deadSopenharmony_ci 17495bd8deadSopenharmony_ciDependencies on OES_shader_multisample_interpolation 17505bd8deadSopenharmony_ci 17515bd8deadSopenharmony_ci If OES_shader_multisample_interpolation is not supported ignore all 17525bd8deadSopenharmony_ci references to the "sample in" and "sample out" qualifiers. 17535bd8deadSopenharmony_ci 17545bd8deadSopenharmony_ciNew State 17555bd8deadSopenharmony_ci 17565bd8deadSopenharmony_ci Add new table 20.1ts "Current Values and Associated Data" preceding table 17575bd8deadSopenharmony_ci 20.2 on p. 354: 17585bd8deadSopenharmony_ci 17595bd8deadSopenharmony_ci Default 17605bd8deadSopenharmony_ci Get Value Type Get Command Value Description Sec. 17615bd8deadSopenharmony_ci ------------------------ ---- -------------- --------- ------------------------ ------------ 17625bd8deadSopenharmony_ci PATCH_VERTICES_EXT Z+ GetIntegerv 3 Number of vertices in 10.1.7sp 17635bd8deadSopenharmony_ci input patch 17645bd8deadSopenharmony_ci 17655bd8deadSopenharmony_ci Add to table 20.19, "Program Pipeline Object State": 17665bd8deadSopenharmony_ci 17675bd8deadSopenharmony_ci Initial 17685bd8deadSopenharmony_ci Get Value Type Get Command Value Description Sec 17695bd8deadSopenharmony_ci -------------------------- ---- -------------------- ------- -------------------------------- --- 17705bd8deadSopenharmony_ci TESS_CONTROL_SHADER_EXT Z+ GetProgramPipelineiv 0 Name of current tess. control 7.4 17715bd8deadSopenharmony_ci shader program object 17725bd8deadSopenharmony_ci TESS_EVALUATION_SHADER_EXT Z+ GetProgramPipelineiv 0 Name of current tess. evaluation 7.4 17735bd8deadSopenharmony_ci shader program object 17745bd8deadSopenharmony_ci 17755bd8deadSopenharmony_ci Add new table 20.25ts, "Program Object State (cont.)": 17765bd8deadSopenharmony_ci 17775bd8deadSopenharmony_ci Default 17785bd8deadSopenharmony_ci Get Value Type Get Command Value Description Sec. 17795bd8deadSopenharmony_ci -------------------------------- ---- ------------ --------- ------------------------ -------- 17805bd8deadSopenharmony_ci TESS_CONTROL_OUTPUT_VERTICES_EXT Z+ GetProgramiv 0 Output patch size 11.1ts.1 17815bd8deadSopenharmony_ci for tess. control shader 17825bd8deadSopenharmony_ci TESS_GEN_MODE_EXT E GetProgramiv QUADS_EXT Base primitive type for 11.1ts.2 17835bd8deadSopenharmony_ci tess. prim. generator 17845bd8deadSopenharmony_ci TESS_GEN_SPACING_EXT E GetProgramiv EQUAL Spacing of tess. prim. 11.1ts.2 17855bd8deadSopenharmony_ci generator edge subdivision 17865bd8deadSopenharmony_ci TESS_GEN_VERTEX_ORDER_EXT E GetProgramiv CCW Order of vertices in 11.1ts.2 17875bd8deadSopenharmony_ci primitives generated by 17885bd8deadSopenharmony_ci tess. prim generator 17895bd8deadSopenharmony_ci TESS_GEN_POINT_MODE_EXT B GetProgramiv FALSE Tess prim. generator 11.1ts.2 17905bd8deadSopenharmony_ci emits points? 17915bd8deadSopenharmony_ci 17925bd8deadSopenharmony_ci Add to table 20.28, "Program Object Resource State (cont.)": 17935bd8deadSopenharmony_ci 17945bd8deadSopenharmony_ci Initial 17955bd8deadSopenharmony_ci Get Value Type Get Command Value Description Sec. 17965bd8deadSopenharmony_ci ---------------------------------------- ---- -------------------- ------- ----------------------- ----- 17975bd8deadSopenharmony_ci REFERENCED_BY_TESS_CONTROL_SHADER_EXT Z+ GetProgramResourceiv - Active resource used by 7.3.1 17985bd8deadSopenharmony_ci tess. control shader? 17995bd8deadSopenharmony_ci REFERENCED_BY_TESS_EVALUATION_SHADER_EXT Z+ GetProgramResourceiv - Active resource used by 7.3.1 18005bd8deadSopenharmony_ci tess. eval. shader? 18015bd8deadSopenharmony_ci 18025bd8deadSopenharmony_ciNew Implementation Dependent State 18035bd8deadSopenharmony_ci 18045bd8deadSopenharmony_ci Add to table 20.39 "Implementation Dependent Values": 18055bd8deadSopenharmony_ci 18065bd8deadSopenharmony_ci Minimum 18075bd8deadSopenharmony_ci Get Value Type Get Command Value Description Sec. 18085bd8deadSopenharmony_ci ------------------------------------------- ---- ----------- ------- ---------------------------- ------ 18095bd8deadSopenharmony_ci PRIMITIVE_RESTART_FOR_PATCHES_SUPPORTED_EXT B GetBooleanv - True if primitive restart is 10.3.4 18105bd8deadSopenharmony_ci supported for patches 18115bd8deadSopenharmony_ci 18125bd8deadSopenharmony_ci Add new table 20.43ts "Implementation Dependent Tessellation Shader Limits" 18135bd8deadSopenharmony_ci following table 6.31 "Implementation Dependent Vertex Shader Limits": 18145bd8deadSopenharmony_ci 18155bd8deadSopenharmony_ci Minimum 18165bd8deadSopenharmony_ci Get Value Type Get Command Value Description Sec. 18175bd8deadSopenharmony_ci ------------------------- ---- ----------- ------- ------------------------------- ------ 18185bd8deadSopenharmony_ci MAX_TESS_GEN_LEVEL_EXT Z+ GetIntegerv 64 Max. level supported by 11.1ts.2 18195bd8deadSopenharmony_ci tess. primitive generator 18205bd8deadSopenharmony_ci MAX_PATCH_VERTICES_EXT Z+ GetIntegerv 32 Maximum patch size 10.1 18215bd8deadSopenharmony_ci MAX_TESS_CONTROL_UNIFORM_COMPONENTS_EXT Z+ GetIntegerv 1024 No. of words for TCS uniforms 11.1ts.1.1 18225bd8deadSopenharmony_ci MAX_TESS_EVALUATION_UNIFORM_COMPONENTS_EXT Z+ GetIntegerv 1024 No. of words for TES uniforms 11.1ts.3.1 18235bd8deadSopenharmony_ci MAX_TESS_CONTROL_TEXTURE_IMAGE_UNITS_EXT Z+ GetIntegerv 16 No. of tex. image units for TCS 11.1.3.5 18245bd8deadSopenharmony_ci MAX_TESS_EVALUATION_TEXTURE_IMAGE_UNITS_EXT Z+ GetIntegerv 16 No. of tex. image units for TES 11.1.3.5 18255bd8deadSopenharmony_ci MAX_TESS_CONTROL_OUTPUT_COMPONENTS_EXT Z+ GetIntegerv 64 No. components for per-patch 11.1ts.1.2 18265bd8deadSopenharmony_ci vertex outputs in TCS 18275bd8deadSopenharmony_ci MAX_TESS_PATCH_COMPONENTS_EXT Z+ GetIntegerv 120 No. components for per-patch 11.1ts.1.2 18285bd8deadSopenharmony_ci output varyings for TCS 18295bd8deadSopenharmony_ci MAX_TESS_CONTROL_TOTAL_OUTPUT_COMPONENTS_EXT Z+ GetIntegerv 2048 Total no. components for TCS 11.1ts.1.2 18305bd8deadSopenharmony_ci outputs 18315bd8deadSopenharmony_ci MAX_TESS_EVALUATION_OUTPUT_COMPONENTS_EXT Z+ GetIntegerv 64 No. components for per-vertex 11.1ts.3.2 18325bd8deadSopenharmony_ci outputs in TES 18335bd8deadSopenharmony_ci MAX_TESS_CONTROL_INPUT_COMPONENTS_EXT Z+ GetIntegerv 64 No. components for per-vertex 11.1ts.1.2 18345bd8deadSopenharmony_ci inputs in TCS 18355bd8deadSopenharmony_ci MAX_TESS_EVALUATION_INPUT_COMPONENTS_EXT Z+ GetIntegerv 64 No. components for per-vertex 11.1ts.3.2 18365bd8deadSopenharmony_ci inputs in TES 18375bd8deadSopenharmony_ci MAX_TESS_CONTROL_UNIFORM_BLOCKS_EXT Z+ GetIntegerv 12 No. of supported uniform 7.6.2 18385bd8deadSopenharmony_ci blocks for TCS 18395bd8deadSopenharmony_ci MAX_TESS_EVALUATION_UNIFORM_BLOCKS_EXT Z+ GetIntegerv 12 No. of supported uniform 7.6.2 18405bd8deadSopenharmony_ci blocks for TES 18415bd8deadSopenharmony_ci MAX_TESS_CONTROL_ATOMIC_COUNTER_BUFFERS_EXT Z+ GetIntegerv 0 No. of AC (atomic counter) 7.7 18425bd8deadSopenharmony_ci buffers accessed by a TCS 18435bd8deadSopenharmony_ci MAX_TESS_EVALUATION_ATOMIC_COUNTER_BUFFERS_EXT Z+ GetIntegerv 0 No. of AC (atomic counter) 7.7 18445bd8deadSopenharmony_ci buffers accessed by a TES 18455bd8deadSopenharmony_ci MAX_TESS_CONTROL_ATOMIC_COUNTERS_EXT Z+ GetIntegerv 0 Number of ACs accessed by a TCS 11.1.3.6 18465bd8deadSopenharmony_ci MAX_TESS_EVALUATION_ATOMIC_COUNTERS_EXT Z+ GetIntegerv 0 Number of ACs accessed by a TES 11.1.3.6 18475bd8deadSopenharmony_ci MAX_TESS_CONTROL_SHADER_STORAGE_BLOCKS_EXT Z+ GetIntegerv 0 No. of shader storage blocks 7.8 18485bd8deadSopenharmony_ci accessed by a TCS 18495bd8deadSopenharmony_ci MAX_TESS_EVALUATION_SHADER_STORAGE_BLOCKS_EXT Z+ GetIntegerv 0 No. of shader storage blocks 7.8 18505bd8deadSopenharmony_ci accessed by a TES 18515bd8deadSopenharmony_ci 18525bd8deadSopenharmony_ci 18535bd8deadSopenharmony_ci Add to table 20.46 "Implementation Dependent Aggregate Shader Limits" 18545bd8deadSopenharmony_ci ([fn] is a dagger mark referring to existing text in the table caption): 18555bd8deadSopenharmony_ci 18565bd8deadSopenharmony_ci 18575bd8deadSopenharmony_ci Minimum 18585bd8deadSopenharmony_ci Get Value Type Get Command Value Description Sec. 18595bd8deadSopenharmony_ci --------------------------------------------------- ---- ----------- ------- ----------------------------- ---------- 18605bd8deadSopenharmony_ci MAX_TESS_CONTROL_IMAGE_UNIFORMS_EXT Z+ GetIntegerv 0 No. of image variables in TCS 11.1.3.7 18615bd8deadSopenharmony_ci in TCS 18625bd8deadSopenharmony_ci MAX_TESS_EVALUATION_IMAGE_UNIFORMS_EXT Z+ GetIntegerv 0 No. of image variables in TES 11.1.3.7 18635bd8deadSopenharmony_ci MAX_COMBINED_TESS_CONTROL_UNIFORM_COMPONENTS_EXT Z+ GetIntegerv [fn] No. of words for TCS uniform 11.1ts.1.1 18645bd8deadSopenharmony_ci variables in all uniform 18655bd8deadSopenharmony_ci blocks (including default) 18665bd8deadSopenharmony_ci MAX_COMBINED_TESS_EVALUATION_UNIFORM_COMPONENTS_EXT Z+ GetIntegerv [fn] No. of words for TES uniform 11.1ts.3.1 18675bd8deadSopenharmony_ci variables in all uniform 18685bd8deadSopenharmony_ci blocks (including default) 18695bd8deadSopenharmony_ci 18705bd8deadSopenharmony_ci Modify existing entries in table 20.46: 18715bd8deadSopenharmony_ci 18725bd8deadSopenharmony_ci Minimum 18735bd8deadSopenharmony_ci Get Value Type Get Command Value Description Sec. 18745bd8deadSopenharmony_ci -------------------------------------------- ---- ----------- ------- -------------------------- ------- 18755bd8deadSopenharmony_ci MAX_UNIFORM_BUFFER_BINDINGS Z+ GetIntegerv 72 Max. no. of uniform buffer 7.6.2 18765bd8deadSopenharmony_ci binding points 18775bd8deadSopenharmony_ci MAX_COMBINED_UNIFORM_BLOCKS Z+ GetIntegerv 60 Max. no. of uniform 7.6.2 18785bd8deadSopenharmony_ci buffers per program 18795bd8deadSopenharmony_ci MAX_COMBINED_TEXTURE_IMAGE_UNITS Z+ GetIntegerv 96 Total no. of tex. units 11.1.3.5 18805bd8deadSopenharmony_ci accessible by the GL 18815bd8deadSopenharmony_ci 18825bd8deadSopenharmony_ciAdditions to the OpenGL ES Shading Language 3.10 Specification 18835bd8deadSopenharmony_ci 18845bd8deadSopenharmony_ci Including the following line in a shader can be used to control the 18855bd8deadSopenharmony_ci language features described in this extension: 18865bd8deadSopenharmony_ci 18875bd8deadSopenharmony_ci #extension GL_EXT_tessellation_shader : <behavior> 18885bd8deadSopenharmony_ci #extension GL_EXT_tessellation_point_size : <behavior> 18895bd8deadSopenharmony_ci 18905bd8deadSopenharmony_ci where <behavior> is as specified in section 3.4. 18915bd8deadSopenharmony_ci 18925bd8deadSopenharmony_ci A new preprocessor #define is added to the OpenGL ES Shading Language: 18935bd8deadSopenharmony_ci 18945bd8deadSopenharmony_ci #define GL_EXT_tessellation_shader 1 18955bd8deadSopenharmony_ci #define GL_EXT_tessellation_point_size 1 18965bd8deadSopenharmony_ci 18975bd8deadSopenharmony_ci If the EXT_tessellation_shader extension is enabled, the 18985bd8deadSopenharmony_ci EXT_shader_io_blocks extension is also implicitly enabled. 18995bd8deadSopenharmony_ci 19005bd8deadSopenharmony_ci 19015bd8deadSopenharmony_ci Change the introduction to Chapter 2 "Overview of OpenGL ES Shading" as 19025bd8deadSopenharmony_ci follows: 19035bd8deadSopenharmony_ci 19045bd8deadSopenharmony_ci The OpenGL ES Shading Language is actually several closely related 19055bd8deadSopenharmony_ci languages. These languages are used to create shaders for each of the 19065bd8deadSopenharmony_ci programmable processors contained in the OpenGL ES processing pipeline. 19075bd8deadSopenharmony_ci Currently, these processors are the compute, vertex, tessellation 19085bd8deadSopenharmony_ci control, tessellation evaluation, geometry, and fragment processors. 19095bd8deadSopenharmony_ci 19105bd8deadSopenharmony_ci Unless otherwise noted in this Specification, a language feature applies 19115bd8deadSopenharmony_ci to all languages, and common usage will refer to these languages as a 19125bd8deadSopenharmony_ci single language. The specific languages will be referred to by the name 19135bd8deadSopenharmony_ci of the processor they target: compute, vertex, tessellation control, 19145bd8deadSopenharmony_ci tessellation evalution, geometry, or fragment. 19155bd8deadSopenharmony_ci 19165bd8deadSopenharmony_ci 19175bd8deadSopenharmony_ci Add new subsections 2.ts1 and 2.ts2 preceding subsection 2.gs "Geometry 19185bd8deadSopenharmony_ci Processor": 19195bd8deadSopenharmony_ci 19205bd8deadSopenharmony_ci Section 2.ts1, Tessellation Control Processor 19215bd8deadSopenharmony_ci 19225bd8deadSopenharmony_ci The <tessellation control processor> is a programmable unit that 19235bd8deadSopenharmony_ci operates on a patch of incoming vertices and their associated data, 19245bd8deadSopenharmony_ci emitting a new output patch. Compilation units written in the OpenGL ES 19255bd8deadSopenharmony_ci Shading Language to run on this processor are called tessellation 19265bd8deadSopenharmony_ci control shaders. When a tessellation control shader is compiled and 19275bd8deadSopenharmony_ci linked, it results in a tessellation control shader executable that runs 19285bd8deadSopenharmony_ci on the tessellation control processor. 19295bd8deadSopenharmony_ci 19305bd8deadSopenharmony_ci The tessellation control processor is invoked for each each vertex of 19315bd8deadSopenharmony_ci the output patch. Each invocation can read the attributes of any vertex 19325bd8deadSopenharmony_ci in the input or output patches, but can only write per-vertex attributes 19335bd8deadSopenharmony_ci for the corresponding output patch vertex. The shader invocations 19345bd8deadSopenharmony_ci collectively produce a set of per-patch attributes for the output patch. 19355bd8deadSopenharmony_ci After all tessellation control shader invocations have completed, the 19365bd8deadSopenharmony_ci output vertices and per-patch attributes are assembled to form a patch 19375bd8deadSopenharmony_ci to be used by subsequent pipeline stages. 19385bd8deadSopenharmony_ci 19395bd8deadSopenharmony_ci Tessellation control shader invocations run mostly independently, with 19405bd8deadSopenharmony_ci undefined relative execution order. However, the built-in function 19415bd8deadSopenharmony_ci barrier() can be used to control execution order by synchronizing 19425bd8deadSopenharmony_ci invocations, effectively dividing tessellation control shader execution 19435bd8deadSopenharmony_ci into a set of phases. Tessellation control shaders will get undefined 19445bd8deadSopenharmony_ci results if one invocation reads a per-vertex or per-patch attribute 19455bd8deadSopenharmony_ci written by another invocation at any point during the same phase, or if 19465bd8deadSopenharmony_ci two invocations attempt to write different values to the same per-patch 19475bd8deadSopenharmony_ci output in a single phase. 19485bd8deadSopenharmony_ci 19495bd8deadSopenharmony_ci Section 2.ts2, Tessellation Evaluation Processor 19505bd8deadSopenharmony_ci 19515bd8deadSopenharmony_ci The <tessellation evaluation processor> is a programmable unit that 19525bd8deadSopenharmony_ci evaluates the position and other attributes of a vertex generated by the 19535bd8deadSopenharmony_ci tessellation primitive generator, using a patch of incoming vertices and 19545bd8deadSopenharmony_ci their associated data. Compilation units written in the OpenGL ES 19555bd8deadSopenharmony_ci Shading Language to run on this processor are called tessellation 19565bd8deadSopenharmony_ci evaluation shaders. When a tessellation evaluation shader is compiled 19575bd8deadSopenharmony_ci and linked, it results in a tessellation evaluation shader executable 19585bd8deadSopenharmony_ci that runs on the tessellation evaluation processor. 19595bd8deadSopenharmony_ci 19605bd8deadSopenharmony_ci Each invocation of the tessellation evaluation executable computes the 19615bd8deadSopenharmony_ci position and attributes of a single vertex generated by the tessellation 19625bd8deadSopenharmony_ci primitive generator. The executable can read the attributes of any 19635bd8deadSopenharmony_ci vertex in the input patch, plus the tessellation coordinate, which is 19645bd8deadSopenharmony_ci the relative location of the vertex in the primitive being tessellated. 19655bd8deadSopenharmony_ci The executable writes the position and other attributes of the vertex. 19665bd8deadSopenharmony_ci 19675bd8deadSopenharmony_ci 19685bd8deadSopenharmony_ci Modifications to Section 3.7 (Keywords) 19695bd8deadSopenharmony_ci 19705bd8deadSopenharmony_ci Remove "patch" from the list of reserved keywords and add it to the list 19715bd8deadSopenharmony_ci of keywords. 19725bd8deadSopenharmony_ci 19735bd8deadSopenharmony_ci 19745bd8deadSopenharmony_ci Modify Section 4.3, Storage Qualifiers 19755bd8deadSopenharmony_ci 19765bd8deadSopenharmony_ci Add two new qualifiers to the storage qualifier table on p. 38: 19775bd8deadSopenharmony_ci 19785bd8deadSopenharmony_ci Qualifier Meaning 19795bd8deadSopenharmony_ci --------- ------------------------------------------------------------- 19805bd8deadSopenharmony_ci patch in linkage of per-patch attributes into a shader from a previous 19815bd8deadSopenharmony_ci stage (tessellation evaluation shaders only) 19825bd8deadSopenharmony_ci 19835bd8deadSopenharmony_ci patch out linkage out of a shader to a subsequent stage (tessellation 19845bd8deadSopenharmony_ci control shaders only) 19855bd8deadSopenharmony_ci 19865bd8deadSopenharmony_ci 19875bd8deadSopenharmony_ci Modify section 4.3.4, Input Variables 19885bd8deadSopenharmony_ci 19895bd8deadSopenharmony_ci Replace the paragraphs starting with "Geometry shader input variables 19905bd8deadSopenharmony_ci get ..." and ending with "Fragment shader inputs get ..." on p. 40: 19915bd8deadSopenharmony_ci 19925bd8deadSopenharmony_ci Tessellation control, evaluation, and geometry shader input variables 19935bd8deadSopenharmony_ci get the per-vertex values written out by output variables of the same 19945bd8deadSopenharmony_ci names in the previous active (vertex) shader stage. For these inputs, 19955bd8deadSopenharmony_ci "centroid in", "sample in", and interpolation qualifiers are allowed, 19965bd8deadSopenharmony_ci but are equivalent to "in". Since these shader stages operate on a set 19975bd8deadSopenharmony_ci of vertices, each input variable or input block (see section 4.3.9 19985bd8deadSopenharmony_ci "Interface Blocks") needs to be declared as an array. For example, 19995bd8deadSopenharmony_ci 20005bd8deadSopenharmony_ci in float foo[]; // geometry shader input for vertex "out float foo" 20015bd8deadSopenharmony_ci 20025bd8deadSopenharmony_ci Each element of such an array corresponds to one vertex of the primitive 20035bd8deadSopenharmony_ci being processed. Each array can optionally have a size declared. The 20045bd8deadSopenharmony_ci array size will be set by (or if provided must be consistent with) the 20055bd8deadSopenharmony_ci input layout declaration(s) establishing the type of input primitive, as 20065bd8deadSopenharmony_ci described later in section 4.4.1 "Input Layout Qualifiers". 20075bd8deadSopenharmony_ci 20085bd8deadSopenharmony_ci Some inputs and outputs are <arrayed>, meaning that for an interface 20095bd8deadSopenharmony_ci between two shader stages either the input or output declaration 20105bd8deadSopenharmony_ci requires an extra level of array indexing for the declarations to match. 20115bd8deadSopenharmony_ci For example, with the interface between a vertex shader and a geometry 20125bd8deadSopenharmony_ci shader, vertex shader output variables and geometry shader input 20135bd8deadSopenharmony_ci variables of the same name must match in type and qualification (other 20145bd8deadSopenharmony_ci than precision and "out" matching to "in"), except that the geometry 20155bd8deadSopenharmony_ci shader will have one more array dimension than the vertex shader, to 20165bd8deadSopenharmony_ci allow for vertex indexing. If such an arrayed interface variable is not 20175bd8deadSopenharmony_ci declared with the necessary additional input or output array dimension, 20185bd8deadSopenharmony_ci a link-time error will result. 20195bd8deadSopenharmony_ci 20205bd8deadSopenharmony_ci For non-arrayed interfaces (meaning array dimensionally stays the same 20215bd8deadSopenharmony_ci between stages), it is a link-time error if the input variable is not 20225bd8deadSopenharmony_ci declared with the same type, including array dimensionality, and 20235bd8deadSopenharmony_ci qualification (other than precision and "out" matching to "in") as the 20245bd8deadSopenharmony_ci matching output variable. 20255bd8deadSopenharmony_ci 20265bd8deadSopenharmony_ci Additionally, tessellation evaluation shaders support per-patch input 20275bd8deadSopenharmony_ci variables declared with the "patch in" qualifier. Per-patch input 20285bd8deadSopenharmony_ci variables are filled with the values of per-patch output variables 20295bd8deadSopenharmony_ci written by the tessellation control shader. Per-patch inputs may be 20305bd8deadSopenharmony_ci declared as one-dimensional arrays, but are not indexed by vertex 20315bd8deadSopenharmony_ci number. Applying the "patch in" qualifier to inputs can only be done in 20325bd8deadSopenharmony_ci tessellation evaluation shaders. As with other input variables, 20335bd8deadSopenharmony_ci per-patch inputs must be declared using the same type and qualification 20345bd8deadSopenharmony_ci (other than precision and "out" matching to "in") as per-patch outputs 20355bd8deadSopenharmony_ci from the previous (tessellation control) shader stage. 20365bd8deadSopenharmony_ci 20375bd8deadSopenharmony_ci It is a compile-time error to use the "patch in" qualifier with inputs 20385bd8deadSopenharmony_ci in any type of shader other than tessellation evaluation. 20395bd8deadSopenharmony_ci 20405bd8deadSopenharmony_ci Fragment shader inputs get ... 20415bd8deadSopenharmony_ci 20425bd8deadSopenharmony_ci 20435bd8deadSopenharmony_ci Modify section 4.3.6 "Output Variables" starting with the third 20445bd8deadSopenharmony_ci paragraph of the section, on p. 42: 20455bd8deadSopenharmony_ci 20465bd8deadSopenharmony_ci Vertex, tessellation evaluation, and geometry output variables output 20475bd8deadSopenharmony_ci per-vertex data and are declared using the "out", "centroid out", or 20485bd8deadSopenharmony_ci "sample out" storage qualifiers. Applying the "patch out" qualifier to 20495bd8deadSopenharmony_ci an output can only be done in tessellation control shaders. Output 20505bd8deadSopenharmony_ci variables can only be floating-point scalars, floating-point vectors, 20515bd8deadSopenharmony_ci matrices, signed or unsigned integers or integer vectors, or arrays or 20525bd8deadSopenharmony_ci structures of any of these. 20535bd8deadSopenharmony_ci 20545bd8deadSopenharmony_ci It is a compile-time error to use the "patch out" qualifier with outputs 20555bd8deadSopenharmony_ci in any other type of shader other than tessellation control. 20565bd8deadSopenharmony_ci 20575bd8deadSopenharmony_ci Individual vertex, tessellation control, tessellation evaluation, and 20585bd8deadSopenharmony_ci geometry outputs are declared as in the following examples: ... 20595bd8deadSopenharmony_ci 20605bd8deadSopenharmony_ci 20615bd8deadSopenharmony_ci Following this modified language and leading into the last paragraph of 20625bd8deadSopenharmony_ci section 4.3.6 on p. 37 (starting "Fragment outputs output 20635bd8deadSopenharmony_ci per-fragment"), add: 20645bd8deadSopenharmony_ci 20655bd8deadSopenharmony_ci Tessellation control shader output variables are used to output 20665bd8deadSopenharmony_ci per-vertex and per-patch data. Per-vertex output variables are arrayed 20675bd8deadSopenharmony_ci (see "arrayed" in section 4.3.4, "Inputs") and declared using the "out", 20685bd8deadSopenharmony_ci "centroid out", or "sample out" qualifiers; the "patch out" qualifier is 20695bd8deadSopenharmony_ci not allowed. Per-patch output variables must be declared using the 20705bd8deadSopenharmony_ci "patch out" qualifier. Per-vertex and per-patch output variables can 20715bd8deadSopenharmony_ci only be floating-point scalars, vectors, or matrices, signed or unsigned 20725bd8deadSopenharmony_ci integers or integer vectors, or arrays or structures of these. Since 20735bd8deadSopenharmony_ci tessellation control shaders produce an arrayed primitive comprising 20745bd8deadSopenharmony_ci multiple vertices, each per-vertex output variable (or output block, see 20755bd8deadSopenharmony_ci interface blocks below) needs to be declared as an array. For example, 20765bd8deadSopenharmony_ci 20775bd8deadSopenharmony_ci out float foo[]; // feeds next stage input "in float foo[]" 20785bd8deadSopenharmony_ci 20795bd8deadSopenharmony_ci Each element of such an array corresponds to one vertex of the primitive 20805bd8deadSopenharmony_ci being produced. Each array can optionally have a size declared. The 20815bd8deadSopenharmony_ci array size will be set by (or if provided must be consistent with) the 20825bd8deadSopenharmony_ci output layout declaration(s) establishing the number of vertices in the 20835bd8deadSopenharmony_ci output patch, as described later in section 4.4.2.ts "Tessellation 20845bd8deadSopenharmony_ci Control Outputs". 20855bd8deadSopenharmony_ci 20865bd8deadSopenharmony_ci Each tessellation control shader invocation has a corresponding output 20875bd8deadSopenharmony_ci patch vertex, and may assign values to per-vertex outputs only if they 20885bd8deadSopenharmony_ci belong to that corresponding vertex. If a per-vertex output variable is 20895bd8deadSopenharmony_ci used as an l-value, it is a compile- or link-time error if the expression 20905bd8deadSopenharmony_ci indicating the vertex index is not the identifier gl_InvocationID. 20915bd8deadSopenharmony_ci 20925bd8deadSopenharmony_ci The order of execution of a tessellation control shader invocation 20935bd8deadSopenharmony_ci relative to the other invocations for the same input patch is undefined 20945bd8deadSopenharmony_ci unless the built-in function barrier() is used. This provides some 20955bd8deadSopenharmony_ci control over relative execution order. When a shader invocation calls 20965bd8deadSopenharmony_ci barrier(), its execution pauses until all other invocations have reached 20975bd8deadSopenharmony_ci the same point of execution. Output variable assignments performed by 20985bd8deadSopenharmony_ci any invocation executed prior to calling barrier() will be visible to 20995bd8deadSopenharmony_ci any other invocation after the call to barrier() returns. 21005bd8deadSopenharmony_ci 21015bd8deadSopenharmony_ci Because tessellation control shader invocations execute in undefined 21025bd8deadSopenharmony_ci order between barriers, the values of per-vertex or per-patch output 21035bd8deadSopenharmony_ci variables will sometimes be undefined. Consider the beginning and end of 21045bd8deadSopenharmony_ci shader execution and each call to barrier() as synchronization points. 21055bd8deadSopenharmony_ci The value of an output variable will be undefined in any of the three 21065bd8deadSopenharmony_ci following cases: 21075bd8deadSopenharmony_ci 21085bd8deadSopenharmony_ci 1. At the beginning of execution. 21095bd8deadSopenharmony_ci 21105bd8deadSopenharmony_ci 2. At each synchronization point, unless 21115bd8deadSopenharmony_ci * the value was well-defined after the previous synchronization point 21125bd8deadSopenharmony_ci and was not written by any invocation since, or 21135bd8deadSopenharmony_ci * the value was written by exactly one shader invocation since the 21145bd8deadSopenharmony_ci previous synchronization point, or 21155bd8deadSopenharmony_ci * the value was written by multiple shader invocations since the 21165bd8deadSopenharmony_ci previous synchronization point, and the last write performed by all 21175bd8deadSopenharmony_ci such invocations wrote the same value. 21185bd8deadSopenharmony_ci 3. When read by a shader invocation, if 21195bd8deadSopenharmony_ci * the value was undefined at the previous synchronization point and 21205bd8deadSopenharmony_ci has not been writen by the same shader invocation since, or 21215bd8deadSopenharmony_ci * the output variable is written to by any other shader invocation 21225bd8deadSopenharmony_ci between the previous and next synchronization points, even if that 21235bd8deadSopenharmony_ci assignment occurs in code following the read. 21245bd8deadSopenharmony_ci 21255bd8deadSopenharmony_ci Fragment outputs output per-fragment data and are declared ... 21265bd8deadSopenharmony_ci 21275bd8deadSopenharmony_ci 21285bd8deadSopenharmony_ci Modify section 4.4.1 "Input Layout Qualifiers" to add new subsections 21295bd8deadSopenharmony_ci 4.4.1.ts and 4.4.2.ts, preceding the new subsection 4.4.1.gs "Geometry 21305bd8deadSopenharmony_ci Shader Inputs": 21315bd8deadSopenharmony_ci 21325bd8deadSopenharmony_ci Section 4.4.1.ts, Tessellation Evaluation Inputs 21335bd8deadSopenharmony_ci 21345bd8deadSopenharmony_ci Additional input layout qualifier identifiers allowed for tessellation 21355bd8deadSopenharmony_ci evaluation shaders are: 21365bd8deadSopenharmony_ci 21375bd8deadSopenharmony_ci <layout-qualifier-id> 21385bd8deadSopenharmony_ci triangles 21395bd8deadSopenharmony_ci quads 21405bd8deadSopenharmony_ci isolines 21415bd8deadSopenharmony_ci equal_spacing 21425bd8deadSopenharmony_ci fractional_even_spacing 21435bd8deadSopenharmony_ci fractional_odd_spacing 21445bd8deadSopenharmony_ci cw 21455bd8deadSopenharmony_ci ccw 21465bd8deadSopenharmony_ci point_mode 21475bd8deadSopenharmony_ci 21485bd8deadSopenharmony_ci One group of these identifiers, <primitive mode>, is used to specify a 21495bd8deadSopenharmony_ci tessellation primitive mode to be used by the tessellation primitive 21505bd8deadSopenharmony_ci generator. To specify a primitive mode, the identifier must be one of 21515bd8deadSopenharmony_ci "triangles", "quads", or "isolines", which specify that the tessellation 21525bd8deadSopenharmony_ci primitive generator should subdivide a triangle into smaller triangles, 21535bd8deadSopenharmony_ci a quad into triangles, or a quad into a collection of lines, 21545bd8deadSopenharmony_ci respectively. 21555bd8deadSopenharmony_ci 21565bd8deadSopenharmony_ci A second group of these identifiers, <vertex spacing>, is used to 21575bd8deadSopenharmony_ci specify the spacing used by the tessellation primitive generator when 21585bd8deadSopenharmony_ci subdividing an edge. To specify vertex spacing, the identifier must be 21595bd8deadSopenharmony_ci one of: 21605bd8deadSopenharmony_ci 21615bd8deadSopenharmony_ci * "equal_spacing", signifying that edges should be divided into a 21625bd8deadSopenharmony_ci collection of <N> equal-sized segments; 21635bd8deadSopenharmony_ci 21645bd8deadSopenharmony_ci * "fractional_even_spacing", signifying that edges should be divided 21655bd8deadSopenharmony_ci into an even number of equal-length segments plus two additional 21665bd8deadSopenharmony_ci shorter "fractional" segments; or 21675bd8deadSopenharmony_ci 21685bd8deadSopenharmony_ci * "fractional_odd_spacing", signifying that edges should be divided 21695bd8deadSopenharmony_ci into an odd number of equal-length segments plus two additional 21705bd8deadSopenharmony_ci shorter "fractional" segments. 21715bd8deadSopenharmony_ci 21725bd8deadSopenharmony_ci A third subset of these identifiers, <ordering>, specifies whether the 21735bd8deadSopenharmony_ci tessellation primitive generator produces triangles in clockwise or 21745bd8deadSopenharmony_ci counter-clockwise order, according to the coordinate system depicted in 21755bd8deadSopenharmony_ci the OpenGL ES Specification. The identifiers "cw" and "ccw" indicate 21765bd8deadSopenharmony_ci clockwise and counter-clockwise triangles, respectively. If the 21775bd8deadSopenharmony_ci tessellation primitive generator does not produce triangles, the order 21785bd8deadSopenharmony_ci is ignored. 21795bd8deadSopenharmony_ci 21805bd8deadSopenharmony_ci Finally, <point mode> is specified with the identifier "point_mode" 21815bd8deadSopenharmony_ci indicating that the tessellation primitive generator should produce one 21825bd8deadSopenharmony_ci point for each distinct vertex in the subdivided primitive, rather than 21835bd8deadSopenharmony_ci generating lines or triangles. 21845bd8deadSopenharmony_ci 21855bd8deadSopenharmony_ci Any or all of these identifiers may be specified one or more times in a 21865bd8deadSopenharmony_ci single input layout declaration. 21875bd8deadSopenharmony_ci 21885bd8deadSopenharmony_ci The tessellation evaluation shader object in a program must declare a 21895bd8deadSopenharmony_ci primitive mode in its input layout. Declaring vertex spacing, ordering, 21905bd8deadSopenharmony_ci or point mode identifiers is optional. If spacing or vertex order 21915bd8deadSopenharmony_ci declarations are omitted, the tessellation primitive generator will use 21925bd8deadSopenharmony_ci equal spacing or counter-clockwise vertex ordering, respectively. If a 21935bd8deadSopenharmony_ci point mode declaration is omitted, the tessellation primitive generator 21945bd8deadSopenharmony_ci will produce lines or triangles according to the primitive mode. 21955bd8deadSopenharmony_ci 21965bd8deadSopenharmony_ci 21975bd8deadSopenharmony_ci Section 4.4.2.ts, Tessellation Control Outputs 21985bd8deadSopenharmony_ci 21995bd8deadSopenharmony_ci Other than for the transform feedback layout qualifiers, tessellation 22005bd8deadSopenharmony_ci control shaders allow output layout qualifiers only on the interface 22015bd8deadSopenharmony_ci qualifier "out", not on an output block, block member, or variable 22025bd8deadSopenharmony_ci declaration. The output layout qualifier identifiers allowed for 22035bd8deadSopenharmony_ci tessellation control shaders are: 22045bd8deadSopenharmony_ci 22055bd8deadSopenharmony_ci layout-qualifier-id 22065bd8deadSopenharmony_ci vertices = integer-constant 22075bd8deadSopenharmony_ci 22085bd8deadSopenharmony_ci The identifier "vertices" specifies the number of vertices in the output 22095bd8deadSopenharmony_ci patch produced by the tessellation control shader, which also specifies 22105bd8deadSopenharmony_ci the number of times the tessellation control shader is invoked. It is a 22115bd8deadSopenharmony_ci compile- or link-time error for the output vertex count to be less than 22125bd8deadSopenharmony_ci or equal to zero, or greater than the implementation-dependent maximum 22135bd8deadSopenharmony_ci patch size. 22145bd8deadSopenharmony_ci 22155bd8deadSopenharmony_ci The intrinsically declared tessellation control output array gl_out[] 22165bd8deadSopenharmony_ci will also be sized by any output layout declaration. Hence, the 22175bd8deadSopenharmony_ci expression 22185bd8deadSopenharmony_ci 22195bd8deadSopenharmony_ci gl_out.length() 22205bd8deadSopenharmony_ci 22215bd8deadSopenharmony_ci will return the output patch vertex count specified in a previous output 22225bd8deadSopenharmony_ci layout qualifier. For outputs declared without an array size, including 22235bd8deadSopenharmony_ci intrinsically declared outputs (i.e., gl_out), a layout must be declared 22245bd8deadSopenharmony_ci before any use of the method length() or other array use that requires 22255bd8deadSopenharmony_ci its size to be known. 22265bd8deadSopenharmony_ci 22275bd8deadSopenharmony_ci It is a compile-time error if the output patch vertex count specified in 22285bd8deadSopenharmony_ci an output layout qualifier does not match the array size specified in 22295bd8deadSopenharmony_ci any output variable declaration in the same shader. 22305bd8deadSopenharmony_ci 22315bd8deadSopenharmony_ci All tessellation control shader layout declarations in a program must 22325bd8deadSopenharmony_ci specify the same output patch vertex count. There must be at least one 22335bd8deadSopenharmony_ci layout qualifier specifying an output patch vertex count in any program 22345bd8deadSopenharmony_ci containing a tessellation control shader. 22355bd8deadSopenharmony_ci 22365bd8deadSopenharmony_ci 22375bd8deadSopenharmony_ci Modify section 7 to add new subsections 7.1ts1 and 7.1ts2 following 22385bd8deadSopenharmony_ci section 7.1.1 "Vertex Shader Special Variables": 22395bd8deadSopenharmony_ci 22405bd8deadSopenharmony_ci Section 7.1ts1, Tessellation Control Special Variables 22415bd8deadSopenharmony_ci 22425bd8deadSopenharmony_ci In the tessellation control language, built-in variables are 22435bd8deadSopenharmony_ci intrinsically declared as: 22445bd8deadSopenharmony_ci 22455bd8deadSopenharmony_ci [[ If EXT_tessellation_point_size is supported and enabled: ]] 22465bd8deadSopenharmony_ci in gl_PerVertex { 22475bd8deadSopenharmony_ci highp vec4 gl_Position; 22485bd8deadSopenharmony_ci hihgp float gl_PointSize; 22495bd8deadSopenharmony_ci } gl_in[gl_MaxPatchVertices]; 22505bd8deadSopenharmony_ci 22515bd8deadSopenharmony_ci [[ Otherwise: ]] 22525bd8deadSopenharmony_ci in gl_PerVertex { 22535bd8deadSopenharmony_ci highp vec4 gl_Position; 22545bd8deadSopenharmony_ci } gl_in[gl_MaxPatchVertices]; 22555bd8deadSopenharmony_ci 22565bd8deadSopenharmony_ci in highp int gl_PatchVerticesIn; 22575bd8deadSopenharmony_ci in highp int gl_PrimitiveID; 22585bd8deadSopenharmony_ci in highp int gl_InvocationID; 22595bd8deadSopenharmony_ci 22605bd8deadSopenharmony_ci [[ If EXT_tessellation_point_size is supported and enabled: ]] 22615bd8deadSopenharmony_ci out gl_PerVertex { 22625bd8deadSopenharmony_ci highp vec4 gl_Position; 22635bd8deadSopenharmony_ci highp float gl_PointSize; 22645bd8deadSopenharmony_ci } gl_out[]; 22655bd8deadSopenharmony_ci 22665bd8deadSopenharmony_ci [[ Otherwise: ]] 22675bd8deadSopenharmony_ci out gl_PerVertex { 22685bd8deadSopenharmony_ci highp vec4 gl_Position; 22695bd8deadSopenharmony_ci } gl_out[]; 22705bd8deadSopenharmony_ci 22715bd8deadSopenharmony_ci patch out highp float gl_TessLevelOuter[4]; 22725bd8deadSopenharmony_ci patch out highp float gl_TessLevelInner[2]; 22735bd8deadSopenharmony_ci 22745bd8deadSopenharmony_ci 22755bd8deadSopenharmony_ci Section 7.1ts1.1, Tessellation Control Input Variables 22765bd8deadSopenharmony_ci 22775bd8deadSopenharmony_ci gl_Position contains the output written in the previous shader stage to 22785bd8deadSopenharmony_ci gl_Position. 22795bd8deadSopenharmony_ci 22805bd8deadSopenharmony_ci [[ If EXT_tessellation_point_size is supported: ]] 22815bd8deadSopenharmony_ci gl_PointSize contains the output written in the previous shader stage to 22825bd8deadSopenharmony_ci gl_PointSize. 22835bd8deadSopenharmony_ci 22845bd8deadSopenharmony_ci gl_PatchVerticesIn contains the number of vertices in the input patch 22855bd8deadSopenharmony_ci being processed by the shader. A single shader can read patches of 22865bd8deadSopenharmony_ci differing sizes, so the value of gl_PatchVerticesIn may differ between 22875bd8deadSopenharmony_ci patches. 22885bd8deadSopenharmony_ci 22895bd8deadSopenharmony_ci gl_PrimitiveID contains the number of primitives processed by the 22905bd8deadSopenharmony_ci shader since the current set of rendering primitives was started. 22915bd8deadSopenharmony_ci 22925bd8deadSopenharmony_ci gl_InvocationID contains the number of the output patch vertex assigned 22935bd8deadSopenharmony_ci to the tessellation control shader invocation. It is assigned integer 22945bd8deadSopenharmony_ci values in the range [0, N-1], where N is the number of output patch 22955bd8deadSopenharmony_ci vertices per primitive. 22965bd8deadSopenharmony_ci 22975bd8deadSopenharmony_ci 22985bd8deadSopenharmony_ci Section 7.1ts1.2, Tessellation Control Output Variables 22995bd8deadSopenharmony_ci 23005bd8deadSopenharmony_ci gl_Position is used in the same fashion as the 23015bd8deadSopenharmony_ci corresponding output variable in the vertex shader. 23025bd8deadSopenharmony_ci 23035bd8deadSopenharmony_ci [[ If EXT_tessellation_point_size is supported: ]] 23045bd8deadSopenharmony_ci gl_PointSize is used in the same fashion as the corresponding output 23055bd8deadSopenharmony_ci variable in the vertex shader. 23065bd8deadSopenharmony_ci 23075bd8deadSopenharmony_ci The values written to gl_TessLevelOuter and gl_TessLevelInner are 23085bd8deadSopenharmony_ci assigned to the corresponding outer and inner tessellation levels of the 23095bd8deadSopenharmony_ci output patch. They are used by the tessellation primitive generator to 23105bd8deadSopenharmony_ci control primitive tessellation, and may be read by tessellation 23115bd8deadSopenharmony_ci evaluation shaders. 23125bd8deadSopenharmony_ci 23135bd8deadSopenharmony_ci 23145bd8deadSopenharmony_ci Section 7.1ts2, Tessellation Evaluation Special Variables 23155bd8deadSopenharmony_ci 23165bd8deadSopenharmony_ci In the tessellation evaluation language, built-in variables are 23175bd8deadSopenharmony_ci intrinsically declared as: 23185bd8deadSopenharmony_ci 23195bd8deadSopenharmony_ci [[ If EXT_tessellation_point_size is supported and enabled: ]] 23205bd8deadSopenharmony_ci in gl_PerVertex { 23215bd8deadSopenharmony_ci highp vec4 gl_Position; 23225bd8deadSopenharmony_ci highp float gl_PointSize; 23235bd8deadSopenharmony_ci } gl_in[gl_MaxPatchVertices]; 23245bd8deadSopenharmony_ci 23255bd8deadSopenharmony_ci [[ Otherwise: ]] 23265bd8deadSopenharmony_ci in gl_PerVertex { 23275bd8deadSopenharmony_ci highp vec4 gl_Position; 23285bd8deadSopenharmony_ci } gl_in[gl_MaxPatchVertices]; 23295bd8deadSopenharmony_ci 23305bd8deadSopenharmony_ci in highp int gl_PatchVerticesIn; 23315bd8deadSopenharmony_ci in highp int gl_PrimitiveID; 23325bd8deadSopenharmony_ci in highp vec3 gl_TessCoord; 23335bd8deadSopenharmony_ci patch in highp float gl_TessLevelOuter[4]; 23345bd8deadSopenharmony_ci patch in highp float gl_TessLevelInner[2]; 23355bd8deadSopenharmony_ci 23365bd8deadSopenharmony_ci [[ If EXT_tessellation_point_size is supported and enabled: ]] 23375bd8deadSopenharmony_ci out gl_PerVertex { 23385bd8deadSopenharmony_ci highp vec4 gl_Position; 23395bd8deadSopenharmony_ci hihgp float gl_PointSize; 23405bd8deadSopenharmony_ci }; 23415bd8deadSopenharmony_ci 23425bd8deadSopenharmony_ci [[ Otherwise: ]] 23435bd8deadSopenharmony_ci out gl_PerVertex { 23445bd8deadSopenharmony_ci highp vec4 gl_Position; 23455bd8deadSopenharmony_ci }; 23465bd8deadSopenharmony_ci 23475bd8deadSopenharmony_ci Section 7.1ts2.1, Tessellation Evaluation Input Variables 23485bd8deadSopenharmony_ci 23495bd8deadSopenharmony_ci gl_Position contains the output written in the previous shader stage to 23505bd8deadSopenharmony_ci gl_Position. 23515bd8deadSopenharmony_ci 23525bd8deadSopenharmony_ci [[ If EXT_tessellation_point_size is supported: ]] 23535bd8deadSopenharmony_ci gl_PointSize contains the output written in the previous shader stage to 23545bd8deadSopenharmony_ci gl_PointSize. 23555bd8deadSopenharmony_ci 23565bd8deadSopenharmony_ci gl_PatchVerticesIn and gl_PrimitiveID are defined in the same fashion as 23575bd8deadSopenharmony_ci the corresponding input variables in the tessellation control shader. 23585bd8deadSopenharmony_ci 23595bd8deadSopenharmony_ci gl_TessCoord specifies a three-component (u,v,w) vector identifying the 23605bd8deadSopenharmony_ci position of the vertex being processed by the shader relative to the 23615bd8deadSopenharmony_ci primitive being tessellated. Its values will obey the properties 23625bd8deadSopenharmony_ci 23635bd8deadSopenharmony_ci gl_TessCoord.x == 1.0 - (1.0 - gl_TessCoord.x) // two operations performed 23645bd8deadSopenharmony_ci gl_TessCoord.y == 1.0 - (1.0 - gl_TessCoord.y) // two operations performed 23655bd8deadSopenharmony_ci gl_TessCoord.z == 1.0 - (1.0 - gl_TessCoord.z) // two operations performed 23665bd8deadSopenharmony_ci 23675bd8deadSopenharmony_ci gl_TessLevelOuter and gl_TessLevelInner are filled with the corresponding 23685bd8deadSopenharmony_ci output variables written by the active tessellation control shader. 23695bd8deadSopenharmony_ci 23705bd8deadSopenharmony_ci 23715bd8deadSopenharmony_ci Section 7.1ts2.2, Tessellation Evaluation Output Variables 23725bd8deadSopenharmony_ci 23735bd8deadSopenharmony_ci gl_Position is used in the same fashion as the 23745bd8deadSopenharmony_ci corresponding output variable in the vertex shader. 23755bd8deadSopenharmony_ci 23765bd8deadSopenharmony_ci [[ If EXT_tessellation_point_size is supported: ]] 23775bd8deadSopenharmony_ci gl_PointSize is used in the same fashion as the corresponding output 23785bd8deadSopenharmony_ci variable in the vertex shader. 23795bd8deadSopenharmony_ci 23805bd8deadSopenharmony_ci 23815bd8deadSopenharmony_ci Add to Section 7.2 "Built-In Constants", matching the 23825bd8deadSopenharmony_ci corresponding API implementation-dependent limits: 23835bd8deadSopenharmony_ci 23845bd8deadSopenharmony_ci const mediump int gl_MaxTessControlInputComponents = 64; 23855bd8deadSopenharmony_ci const mediump int gl_MaxTessControlOutputComponents = 64; 23865bd8deadSopenharmony_ci const mediump int gl_MaxTessControlTextureImageUnits = 16; 23875bd8deadSopenharmony_ci const mediump int gl_MaxTessControlUniformComponents = 1024; 23885bd8deadSopenharmony_ci const mediump int gl_MaxTessControlTotalOutputComponents = 2048; 23895bd8deadSopenharmony_ci 23905bd8deadSopenharmony_ci const mediump int gl_MaxTessEvaluationInputComponents = 64; 23915bd8deadSopenharmony_ci const mediump int gl_MaxTessEvaluationOutputComponents = 64; 23925bd8deadSopenharmony_ci const mediump int gl_MaxTessEvaluationTextureImageUnits = 16; 23935bd8deadSopenharmony_ci const mediump int gl_MaxTessEvaluationUniformComponents = 1024; 23945bd8deadSopenharmony_ci 23955bd8deadSopenharmony_ci const mediump int gl_MaxTessPatchComponents = 120; 23965bd8deadSopenharmony_ci 23975bd8deadSopenharmony_ci const mediump int gl_MaxPatchVertices = 32; 23985bd8deadSopenharmony_ci const mediump int gl_MaxTessGenLevel = 64; 23995bd8deadSopenharmony_ci 24005bd8deadSopenharmony_ci Modify gl_MaxCombinedTextureImageUnits to match the API: 24015bd8deadSopenharmony_ci 24025bd8deadSopenharmony_ci const mediump int gl_MaxCombinedTextureImageUnits = 96; 24035bd8deadSopenharmony_ci 24045bd8deadSopenharmony_ci 24055bd8deadSopenharmony_ci Modify section 8.15 "Shader Invocation Control Functions": 24065bd8deadSopenharmony_ci 24075bd8deadSopenharmony_ci The shader invocation control function is only available in tessellation 24085bd8deadSopenharmony_ci control and compute shaders. It is used to control the relative 24095bd8deadSopenharmony_ci execution order of multiple shader invocations used to process a patch 24105bd8deadSopenharmony_ci (in the case of tessellation control shaders) or a workgroup (in 24115bd8deadSopenharmony_ci the case of compute shaders), which are otherwise executed with an 24125bd8deadSopenharmony_ci undefined order. 24135bd8deadSopenharmony_ci 24145bd8deadSopenharmony_ci +------------------+---------------------------------------------------------------+ 24155bd8deadSopenharmony_ci | Syntax | Description | 24165bd8deadSopenharmony_ci +------------------+---------------------------------------------------------------+ 24175bd8deadSopenharmony_ci | void | For any given static instance of barrier(), all | 24185bd8deadSopenharmony_ci | barrier(void) | tessellation control shader invocations for a single input | 24195bd8deadSopenharmony_ci | | patch, or all compute shader invocations for a single work | 24205bd8deadSopenharmony_ci | | group must enter it before any will continue beyond it. | 24215bd8deadSopenharmony_ci +------------------+---------------------------------------------------------------+ 24225bd8deadSopenharmony_ci 24235bd8deadSopenharmony_ci The function barrier() provides a partially defined order of execution 24245bd8deadSopenharmony_ci between shader invocations. This ensures that values written by one 24255bd8deadSopenharmony_ci invocation prior to a given static instance of barrier() can be safely 24265bd8deadSopenharmony_ci read by other invocations after their call to the same static instance 24275bd8deadSopenharmony_ci barrier(). Because invocations may execute in an undefined order between 24285bd8deadSopenharmony_ci these barrier calls, the values of a per-vertex or per-patch output 24295bd8deadSopenharmony_ci variable for tessellation control shaders, or the values of shared 24305bd8deadSopenharmony_ci variables for compute shaders will be undefined in a number of cases 24315bd8deadSopenharmony_ci enumerated in section 4.3.6 "Output Variables" (for tessellation control 24325bd8deadSopenharmony_ci shaders) and section 4.3.7 "Shared Variables" (for compute shaders). 24335bd8deadSopenharmony_ci 24345bd8deadSopenharmony_ci For tessellation control shaders, the barrier() function may only be 24355bd8deadSopenharmony_ci placed inside the function main() of the shader and may not be called 24365bd8deadSopenharmony_ci within any control flow. Barriers are also disallowed after a return 24375bd8deadSopenharmony_ci statement in the function main(). Any such misplaced barriers result in 24385bd8deadSopenharmony_ci a compile-time error. 24395bd8deadSopenharmony_ci 24405bd8deadSopenharmony_ci For compute shaders, the barrier() function ... 24415bd8deadSopenharmony_ci 24425bd8deadSopenharmony_ci 24435bd8deadSopenharmony_ciIssues 24445bd8deadSopenharmony_ci 24455bd8deadSopenharmony_ci Note: These issues apply specifically to the definition of the 24465bd8deadSopenharmony_ci EXT_tessellation_shader specification, which is based on the OpenGL 24475bd8deadSopenharmony_ci extension ARB_tessellation_shader as updated in OpenGL 4.x. Resolved 24485bd8deadSopenharmony_ci issues from ARB_tessellation_shader have been removed, but remain 24495bd8deadSopenharmony_ci largely applicable to this extension. ARB_tessellation_shader can be 24505bd8deadSopenharmony_ci found in the OpenGL Registry. 24515bd8deadSopenharmony_ci 24525bd8deadSopenharmony_ci (1) What functionality was removed from ARB_tessellation_shader? 24535bd8deadSopenharmony_ci 24545bd8deadSopenharmony_ci Very little. Tessellation shaders are largely self-contained 24555bd8deadSopenharmony_ci functionality and the only removed interactions with features not 24565bd8deadSopenharmony_ci supported by the underlying OpenGL ES 3.1 API and Shading Language 24575bd8deadSopenharmony_ci were: 24585bd8deadSopenharmony_ci * Fixed-function inputs and outputs present only in the GL 24595bd8deadSopenharmony_ci compatibility profile. 24605bd8deadSopenharmony_ci * gl_ClipDistance shader inputs and outputs. 24615bd8deadSopenharmony_ci * While multi-dimensional arrays are supported by GLSL-ES 3.10, 24625bd8deadSopenharmony_ci they are explicitly not supported as shader inputs and outputs, 24635bd8deadSopenharmony_ci and that decision is respected here. 24645bd8deadSopenharmony_ci * Using a tessellation evaluation shader without a tessellation 24655bd8deadSopenharmony_ci control shader is not allowed. See issue 13. 24665bd8deadSopenharmony_ci * PATCH_DEFAULT_*_LEVEL parameters (issue 13). 24675bd8deadSopenharmony_ci 24685bd8deadSopenharmony_ci (2) What functionality was changed and added relative to 24695bd8deadSopenharmony_ci ARB_tessellation_shader? 24705bd8deadSopenharmony_ci 24715bd8deadSopenharmony_ci - EXT_tessellation_shader closely matches OpenGL 4.4 tessellation 24725bd8deadSopenharmony_ci shader language, rather than ARB_tessellation_shader language. 24735bd8deadSopenharmony_ci - Spec language is now based off of changes introduced by 24745bd8deadSopenharmony_ci EXT_geometry_shader, especially with regard to input and output 24755bd8deadSopenharmony_ci blocks. 24765bd8deadSopenharmony_ci - Note that although this spec mentions quad primitives repeatedly, 24775bd8deadSopenharmony_ci this is not inconsistent with the lack of support for QUADS drawing 24785bd8deadSopenharmony_ci primitives in OpenGL ES. The quad primitives discussed here occur 24795bd8deadSopenharmony_ci only during patch tessellation and are emitted as triangles to later 24805bd8deadSopenharmony_ci stages of the pipeline. 24815bd8deadSopenharmony_ci - Writing point size from tessellation shaders is optional functionality. 24825bd8deadSopenharmony_ci If it's not supported or written, the point size of 1.0 is used. 24835bd8deadSopenharmony_ci - Added precision qualifiers to builtins. 24845bd8deadSopenharmony_ci - ARB_tessellation_shader required that the tessellation primitive 24855bd8deadSopenharmony_ci generator reject a patch when any outer tessellation level contained a 24865bd8deadSopenharmony_ci NaN, even if the outer tessellation level is irrelevant for the 24875bd8deadSopenharmony_ci primitive type. As that was likely unintended (see Khronos bug 11484), 24885bd8deadSopenharmony_ci EXT_tessellation_shader only rejects patches if relevant outer 24895bd8deadSopenharmony_ci tessellation levels contain NaN. 24905bd8deadSopenharmony_ci - Added program interface query properties relevant to tessellation 24915bd8deadSopenharmony_ci shaders. 24925bd8deadSopenharmony_ci 24935bd8deadSopenharmony_ci (3) Are any grammar additions required in chapter 9? 24945bd8deadSopenharmony_ci 24955bd8deadSopenharmony_ci Probably, but such changes are not included in the original 24965bd8deadSopenharmony_ci ARB_tessellation_shader extension, either. TBD. 24975bd8deadSopenharmony_ci 24985bd8deadSopenharmony_ci (4) Should GetActiveUniformBlockiv 24995bd8deadSopenharmony_ci support queries for uniform blocks and atomic counter buffers 25005bd8deadSopenharmony_ci referenced by tessellation shaders? 25015bd8deadSopenharmony_ci 25025bd8deadSopenharmony_ci RESOLVED: No. Use the new generic query interface supported by 25035bd8deadSopenharmony_ci OpenGL ES 3.1, following the resolution for other features such as compute 25045bd8deadSopenharmony_ci shaders, which also dropped these legacy tokens / queries. 25055bd8deadSopenharmony_ci 25065bd8deadSopenharmony_ci (5) How are aggregate shader limits computed? 25075bd8deadSopenharmony_ci 25085bd8deadSopenharmony_ci RESOLVED: Following the GL 4.4 model, but we restrict uniform 25095bd8deadSopenharmony_ci buffer bindings to 12/stage instead of 14, this results in 25105bd8deadSopenharmony_ci 25115bd8deadSopenharmony_ci MAX_UNIFORM_BUFFER_BINDINGS = 72 25125bd8deadSopenharmony_ci This is 12 bindings/stage * 6 shader stages, allowing a static 25135bd8deadSopenharmony_ci partitioning of the bindings even though at most 5 stages can 25145bd8deadSopenharmony_ci appear in a program object). 25155bd8deadSopenharmony_ci MAX_COMBINED_UNIFORM_BLOCKS = 60 25165bd8deadSopenharmony_ci This is 12 blocks/stage * 5 stages, since compute shaders can't 25175bd8deadSopenharmony_ci be mixed with other stages. 25185bd8deadSopenharmony_ci MAX_COMBINED_TEXTURE_IMAGE_UNITS = 96 25195bd8deadSopenharmony_ci This is 16 textures/stage * 6 stages. 25205bd8deadSopenharmony_ci 25215bd8deadSopenharmony_ci Khronos internal bugs 5870, 8891, and 9424 cover the ARB's thinking on 25225bd8deadSopenharmony_ci these limits for GL 4.0 and beyond. 25235bd8deadSopenharmony_ci 25245bd8deadSopenharmony_ci (6) Are arrays supported as shader inputs and outputs? 25255bd8deadSopenharmony_ci 25265bd8deadSopenharmony_ci RESOLVED: No. In several places in the tessellation and geometry API 25275bd8deadSopenharmony_ci language based on GL 4.4, it says that "the OpenGL ES Shading Language 25285bd8deadSopenharmony_ci doesn't support multi-dimensional arrays" and restricts declarations of 25295bd8deadSopenharmony_ci inputs and outputs which are array members to blocks themselves declared 25305bd8deadSopenharmony_ci as arrays. 25315bd8deadSopenharmony_ci 25325bd8deadSopenharmony_ci Strictly speaking this is no longer true. GLSL-ES 3.10 supports 25335bd8deadSopenharmony_ci multi-dimensional arrays, but also notes in issue 0 that "arrays of 25345bd8deadSopenharmony_ci arrays are not allowed as shader inputs or outputs." 25355bd8deadSopenharmony_ci 25365bd8deadSopenharmony_ci Given this constraint, and since the same constraint is in OpenGL 4.4, I 25375bd8deadSopenharmony_ci propose we resolve this by continuing to limit array inputs and outputs 25385bd8deadSopenharmony_ci in this fashion, and change the language to "...doesn't support 25395bd8deadSopenharmony_ci multi-dimensional arrays as shader inputs or outputs". 25405bd8deadSopenharmony_ci 25415bd8deadSopenharmony_ci (7) What component counting rules are used for inputs and outputs? 25425bd8deadSopenharmony_ci 25435bd8deadSopenharmony_ci RESOLVED: In several places I've inserted language from OpenGL 4.4 to 25445bd8deadSopenharmony_ci the effect of 25455bd8deadSopenharmony_ci 25465bd8deadSopenharmony_ci "Component counting rules for different variable types and variable 25475bd8deadSopenharmony_ci declarations are the same as for MAX_VERTEX_OUTPUT_COMPONENTS (see 25485bd8deadSopenharmony_ci section 11.1.2.1)." 25495bd8deadSopenharmony_ci 25505bd8deadSopenharmony_ci I think this is essentially cleaning up an oversight in the earlier ARB 25515bd8deadSopenharmony_ci extension language but it is a bit orthogonal to the extension 25525bd8deadSopenharmony_ci functionality and I'm bringing it up in case this is a potential issue. 25535bd8deadSopenharmony_ci 25545bd8deadSopenharmony_ci (8) What component counting rules are used for the default 25555bd8deadSopenharmony_ci uniform block? 25565bd8deadSopenharmony_ci 25575bd8deadSopenharmony_ci RESOLVED: In several places I've inserted language from OpenGL 4.2 to 25585bd8deadSopenharmony_ci the effect of 25595bd8deadSopenharmony_ci 25605bd8deadSopenharmony_ci "A uniform matrix in the default uniform block with single-precision 25615bd8deadSopenharmony_ci components will consume no more than 4 x min(r,c) uniform 25625bd8deadSopenharmony_ci components." 25635bd8deadSopenharmony_ci 25645bd8deadSopenharmony_ci This is based on bug 5432 and is language that was later expanded in 25655bd8deadSopenharmony_ci OpenGL 4.4 and refactored into the generic "Uniform Variables" section, 25665bd8deadSopenharmony_ci which is something we should consider in the EXT extensions as well to 25675bd8deadSopenharmony_ci avoid duplication. I believe it is what we want but am noting it for the 25685bd8deadSopenharmony_ci same reason as the language in issue (8). I'm hoping to be able to 25695bd8deadSopenharmony_ci include this refactored language into the OpenGL ES 3.1 Specification, 25705bd8deadSopenharmony_ci so we can refer to it more easily here. Tracking bug 11192 has been 25715bd8deadSopenharmony_ci opened for this and this language was approved there. 25725bd8deadSopenharmony_ci 25735bd8deadSopenharmony_ci (9) The edits on section 4.4.1.ts (Tessellation Evaluation Inputs) 25745bd8deadSopenharmony_ci says that "Any or all of these identifiers may be specified one or more 25755bd8deadSopenharmony_ci times in a single input layout declaration." Do we need to add in the 25765bd8deadSopenharmony_ci language from GLSL 4.40 Section 4.4 "Layout Qualifiers" that defines this? 25775bd8deadSopenharmony_ci 25785bd8deadSopenharmony_ci RESOLVED: ES 3.1 will be picking up the relaxed qualifier ordering 25795bd8deadSopenharmony_ci and it is presumed that this language will be coming along with it. 25805bd8deadSopenharmony_ci In any case, the EXT_shader_io_blocks extension clarifies this. 25815bd8deadSopenharmony_ci 25825bd8deadSopenharmony_ci (10) Due to HW limitations, some vendors may not be able 25835bd8deadSopenharmony_ci to support writing gl_PointSize from tessellation shaders, how should we 25845bd8deadSopenharmony_ci accomodate this? 25855bd8deadSopenharmony_ci 25865bd8deadSopenharmony_ci RESOLVED: There are two extensions described in this document. The 25875bd8deadSopenharmony_ci base extension does not support writing to gl_PointSize from tessellation 25885bd8deadSopenharmony_ci shaders and the gl_PerVertex block does not include gl_PointSize. 25895bd8deadSopenharmony_ci Additionally there is a layered extension which provides the ability 25905bd8deadSopenharmony_ci to write to gl_PointSize from tessellation shaders. When this extension 25915bd8deadSopenharmony_ci is enabled, the gl_PerVertex block does include gl_PointSize and it 25925bd8deadSopenharmony_ci can be written from a tessellation control or evaluation shader as normal. 25935bd8deadSopenharmony_ci 25945bd8deadSopenharmony_ci If the point-size extension is not supported, all points written 25955bd8deadSopenharmony_ci from a tessellation shader will have size of one. If the point-size 25965bd8deadSopenharmony_ci extension is supported but not enabled, or if it's enabled but 25975bd8deadSopenharmony_ci gl_PointSize is not written, it as if a point size of one was written. 25985bd8deadSopenharmony_ci Otherwise, if you statically assign gl_PointSize in the last stage 25995bd8deadSopenharmony_ci before the rasterizer, the (potentially clamped) value written will 26005bd8deadSopenharmony_ci determine the size of the point for rasterization. 26015bd8deadSopenharmony_ci 26025bd8deadSopenharmony_ci (11) Do we need a separate point_size extension from the one included 26035bd8deadSopenharmony_ci in EXT_geometry_shader or can we use the some one? 26045bd8deadSopenharmony_ci 26055bd8deadSopenharmony_ci RESOLVED. We will use a separate extension to allow for maximum 26065bd8deadSopenharmony_ci implementation flexibility. 26075bd8deadSopenharmony_ci 26085bd8deadSopenharmony_ci (12) Can a tessellation evaluation shader be used without a tessellation 26095bd8deadSopenharmony_ci control shader? 26105bd8deadSopenharmony_ci 26115bd8deadSopenharmony_ci RESULT: No. This isn't allowed in other graphics APIs, and some vendors 26125bd8deadSopenharmony_ci designed hardware based on those APIs. Attempts to draw with only one of the 26135bd8deadSopenharmony_ci two tessellation shaders active results in an INVALID_OPERATION error. 26145bd8deadSopenharmony_ci Vendors that designed hardware for ARB_tessellation_shader or versions of 26155bd8deadSopenharmony_ci OpenGL that included it may choose to relax this restriction via extension. 26165bd8deadSopenharmony_ci One implication of this is that the default tessellation levels are useless, 26175bd8deadSopenharmony_ci since an active tessellation control shader always overrides them, so they 26185bd8deadSopenharmony_ci are not included in this spec. 26195bd8deadSopenharmony_ci 26205bd8deadSopenharmony_ci (13) What happens if you use "patch out" in a tessellation evaluation 26215bd8deadSopenharmony_ci shader or "patch in" in a tessellation control shader? 26225bd8deadSopenharmony_ci 26235bd8deadSopenharmony_ci RESOLVED. GLSL 4.40 spec only says "Applying the patch qualifier to 26245bd8deadSopenharmony_ci inputs can only be done in tessellation evaluation shaders." and 26255bd8deadSopenharmony_ci "Applying patch to an output can only be done in a tessellation control 26265bd8deadSopenharmony_ci shader." There is also a statement that says "It is a compile-time error 26275bd8deadSopenharmony_ci to use patch in a fragment shader." In Bug 11527 the ARB decided this 26285bd8deadSopenharmony_ci should be a compile-time error as this can be determined by solely by 26295bd8deadSopenharmony_ci looking at variable declaration. 26305bd8deadSopenharmony_ci 26315bd8deadSopenharmony_ci (14) Do we need to make accommodations for tile-based implementations? 26325bd8deadSopenharmony_ci 26335bd8deadSopenharmony_ci RESOLVED. Yes, but it will be done as a separate extension as it is 26345bd8deadSopenharmony_ci applicable to more than just tessellation shaders. 26355bd8deadSopenharmony_ci 26365bd8deadSopenharmony_ci (15) Can inputs and outputs from tessellation shaders be arrays of 26375bd8deadSopenharmony_ci structures? 26385bd8deadSopenharmony_ci 26395bd8deadSopenharmony_ci RESOLVED. Yes they can. OpenGL ES 3.1 disallows passing arrays of 26405bd8deadSopenharmony_ci structures between stages. However, since vertex shader outputs 26415bd8deadSopenharmony_ci can be structures we need to add the extra level of 26425bd8deadSopenharmony_ci array-ness when these are accessed from a tessellation control shader. 26435bd8deadSopenharmony_ci Similarly this applies to outputs from a tessellation control shader 26445bd8deadSopenharmony_ci and inputs to a tessellation evaluation shader. However as in GL, 26455bd8deadSopenharmony_ci arrays of arrays are not supported. 26465bd8deadSopenharmony_ci 26475bd8deadSopenharmony_ci (16) Tessellation using "point_mode" is supposed to emit each distinct 26485bd8deadSopenharmony_ci vertex produced by the tessellation primitive generator exactly once. 26495bd8deadSopenharmony_ci Are there cases where this can produce multiple vertices with the same 26505bd8deadSopenharmony_ci position? 26515bd8deadSopenharmony_ci 26525bd8deadSopenharmony_ci RESOLVED: Yes. If fractional odd spacing is used, we have outer 26535bd8deadSopenharmony_ci tessellation levels that are greater than 1.0, and inner tessellation 26545bd8deadSopenharmony_ci levels less than or equal to 1.0, this can occur. If any outer level is 26555bd8deadSopenharmony_ci greater than 1.0, we will subdivide the outer edges of the patch, and 26565bd8deadSopenharmony_ci will need a subdivided patch interior to connect to. We handle this by 26575bd8deadSopenharmony_ci treating inner levels less than or equal to 1.0 as though they were 26585bd8deadSopenharmony_ci slightly greater than 1.0 ("1+epsilon"). 26595bd8deadSopenharmony_ci 26605bd8deadSopenharmony_ci With fractional odd spacing, inner levels between 1.0 and 3.0 will 26615bd8deadSopenharmony_ci produce a three-segment subdivision, with one full-size interior segment 26625bd8deadSopenharmony_ci and two smaller ones on the outside. The following figure illustrates 26635bd8deadSopenharmony_ci what happens to quad tessellation if the horizontal inner LOD (IL0) goes 26645bd8deadSopenharmony_ci from 3.0 toward 1.0 in fractional odd mode: 26655bd8deadSopenharmony_ci 26665bd8deadSopenharmony_ci IL0==3 IL0==2 IL0=1.5 IL0=1.2 26675bd8deadSopenharmony_ci +-----------+ +-----------+ +-----------+ +-----------+ 26685bd8deadSopenharmony_ci | | | | | | | | 26695bd8deadSopenharmony_ci | +---+ | | +-----+ | | +-------+ | |+---------+| 26705bd8deadSopenharmony_ci | | | | | | | | | | | | || || 26715bd8deadSopenharmony_ci | | | | | | | | | | | | || || 26725bd8deadSopenharmony_ci | +---+ | | +-----+ | | +-------+ | |+---------+| 26735bd8deadSopenharmony_ci | | | | | | | | 26745bd8deadSopenharmony_ci +-----------+ +-----------+ +-----------+ +-----------+ 26755bd8deadSopenharmony_ci 26765bd8deadSopenharmony_ci As the inner level approaches 1.0, the vertical inner edges in this 26775bd8deadSopenharmony_ci example get closer and closer to the outer edge. The distance between 26785bd8deadSopenharmony_ci the inner and outer vertical edges approaches zero for an inner level of 26795bd8deadSopenharmony_ci 1+epsilon, and the positions of vertices produced by subdividing such 26805bd8deadSopenharmony_ci edges may be numerically indistinguishable. 26815bd8deadSopenharmony_ci 26825bd8deadSopenharmony_ci (17) Why does this extension not support GLSL built-in constants for the 26835bd8deadSopenharmony_ci following limits? 26845bd8deadSopenharmony_ci 26855bd8deadSopenharmony_ci - gl_MaxTessControlAtomicCounters 26865bd8deadSopenharmony_ci - gl_MaxTessEvaluationAtomicCounters 26875bd8deadSopenharmony_ci - gl_MaxTessControlAtomicCounterBuffers 26885bd8deadSopenharmony_ci - gl_MaxTessEvaluationAtomicCounterBuffers 26895bd8deadSopenharmony_ci - gl_MaxTessControlImageUniforms 26905bd8deadSopenharmony_ci - gl_MaxTessEvaluationImageUniforms 26915bd8deadSopenharmony_ci 26925bd8deadSopenharmony_ci RESOLVED: These were accidentally left out when drafting the extension, 26935bd8deadSopenharmony_ci and cannot be added now because shipping implementations don't support 26945bd8deadSopenharmony_ci them. This was fixed when these extensions were promoted into OpenGL ES 26955bd8deadSopenharmony_ci Shading Language 3.20. 26965bd8deadSopenharmony_ci 26975bd8deadSopenharmony_ciRevision History 26985bd8deadSopenharmony_ci 26995bd8deadSopenharmony_ci Rev. Date Author Changes 27005bd8deadSopenharmony_ci ---- -------- --------- ------------------------------------------------- 27015bd8deadSopenharmony_ci 25 12/10/18 Jon Leech Use 'workgroup' consistently throughout (Bug 27025bd8deadSopenharmony_ci 11723, internal API issue 87). 27035bd8deadSopenharmony_ci 27045bd8deadSopenharmony_ci 24 02/03/17 Jon Leech Add issue 17 noting missing GLSL built-in constants 27055bd8deadSopenharmony_ci (public bug 1427). 27065bd8deadSopenharmony_ci 27075bd8deadSopenharmony_ci 23 05/31/16 Jon Leech Note that primitive ID counters are reset to zero 27085bd8deadSopenharmony_ci after each instance drawn (Bug 14024). 27095bd8deadSopenharmony_ci 27105bd8deadSopenharmony_ci 22 04/29/16 Jon Leech Fix GLSL-ES built-in constants to match API 27115bd8deadSopenharmony_ci limits (Bug 12823). 27125bd8deadSopenharmony_ci 27135bd8deadSopenharmony_ci 21 04/27/16 Jon Leech Reduce minimum value of 27145bd8deadSopenharmony_ci MAX_TESS_CONTROL_TOTAL_OUTPUT_COMPONENTS_EXT Z+ GetIntegerv 2048 Total no. components for TCS 11.1ts.1.2 27155bd8deadSopenharmony_ci from 4096 to 2048 (Bug 12823) 27165bd8deadSopenharmony_ci 27175bd8deadSopenharmony_ci 20 07/23/15 Jon Leech Reduce minimum value of 27185bd8deadSopenharmony_ci MAX_TESS_{CONTROL,EVALUATION}_{IN,OUT}PUT_COMPONENTS 27195bd8deadSopenharmony_ci to 64 (Bug 12823) 27205bd8deadSopenharmony_ci 27215bd8deadSopenharmony_ci 19 05/05/15 dkoch Allow arrays for both per-patch and per-vertex 27225bd8deadSopenharmony_ci TCS outputs (Bug 13658). 27235bd8deadSopenharmony_ci Fix typo in issue 15 suggesting that VS outputs 27245bd8deadSopenharmony_ci could be an array of structures (Bug 13824). 27255bd8deadSopenharmony_ci 27265bd8deadSopenharmony_ci 18 04/20/15 Jon Leech Remove "per-patch" part of description of 27275bd8deadSopenharmony_ci MAX_TESS_CONTROL_TOTAL_OUTPUT_COMPONENTS 27285bd8deadSopenharmony_ci (Bug 13765). 27295bd8deadSopenharmony_ci 27305bd8deadSopenharmony_ci 17 04/29/14 dkoch Add missing edits to Section 12.1 for XFB 27315bd8deadSopenharmony_ci 27325bd8deadSopenharmony_ci 16 04/25/14 dkoch Allow compile-time error for improperly sized 27335bd8deadSopenharmony_ci per-vertex inputs/outputs (Bug 12185). 27345bd8deadSopenharmony_ci Allow link-time error for TCS per-vertex outputs 27355bd8deadSopenharmony_ci not indexed by gl_InvocationID (Bug 12112). 27365bd8deadSopenharmony_ci Add issue 15 clarifying arrays of structs. 27375bd8deadSopenharmony_ci Clarify that the tessellation primitive 27385bd8deadSopenharmony_ci generator may produce multiple vertices with 27395bd8deadSopenharmony_ci the same gl_TessCoord values in point mode when 27405bd8deadSopenharmony_ci fractional odd spacing is used with an inner 27415bd8deadSopenharmony_ci tessellation level less than or equal to 1.0 27425bd8deadSopenharmony_ci (bug 11979) (Issue 16). 27435bd8deadSopenharmony_ci 27445bd8deadSopenharmony_ci 15 04/01/14 dkoch Update contributors, removed duplicated line. 27455bd8deadSopenharmony_ci 27465bd8deadSopenharmony_ci 14 03/28/14 dkoch Fix typo in Isoline tessellation: lines are sub- 27475bd8deadSopenharmony_ci divided based on second outer tessellation level 27485bd8deadSopenharmony_ci not the first (from ARB_ts v.19 and GL 4.4) 27495bd8deadSopenharmony_ci 27505bd8deadSopenharmony_ci 13 03/26/14 Jon Leech Sync with released ES 3.1 specs. Reflow text. 27515bd8deadSopenharmony_ci 27525bd8deadSopenharmony_ci 12 03/21/14 dkoch Update contributors, remove bounding box. 27535bd8deadSopenharmony_ci 27545bd8deadSopenharmony_ci 11 03/10/14 Jon Leech Rebase on OpenGL ES 3.1 and change suffix to EXT. 27555bd8deadSopenharmony_ci 27565bd8deadSopenharmony_ci 10 02/27/14 dkoch Add API edits for bounding box. Issue 15, 16. 27575bd8deadSopenharmony_ci 27585bd8deadSopenharmony_ci 9 02/24/14 dkoch Add missing entry point augmentation. 27595bd8deadSopenharmony_ci 27605bd8deadSopenharmony_ci 8 02/20/14 dkoch 27615bd8deadSopenharmony_ci - resolved issue 14, added language to make it a compile-time error 27625bd8deadSopenharmony_ci 27635bd8deadSopenharmony_ci 7 02/12/14 dkoch 27645bd8deadSopenharmony_ci - Resolve issues 6, 7, and 12. Add issues 14 and 15. 27655bd8deadSopenharmony_ci - Add IS_PER_PATCH program interface query. 27665bd8deadSopenharmony_ci - require EXT_gpu_shader5 for 'precise' functionality. 27675bd8deadSopenharmony_ci - Add error condition for 'patch in' in fragment shader. 27685bd8deadSopenharmony_ci 27695bd8deadSopenharmony_ci 6 01/20/14 dkoch 27705bd8deadSopenharmony_ci - Edits to require both TCS and TES. 27715bd8deadSopenharmony_ci - Remove unnecessary PatchParameterfv and default tessellation levels params. 27725bd8deadSopenharmony_ci - Fix typo in enum name. 27735bd8deadSopenharmony_ci - Update link error for duplicate locations. 27745bd8deadSopenharmony_ci 27755bd8deadSopenharmony_ci 5 12/19/13 dkoch 27765bd8deadSopenharmony_ci - remove legacy NV_primitive_restart interaction 27775bd8deadSopenharmony_ci - add PRIMITIVE_RESTART_FOR_PATCHES_SUPPORTED from GL 4.4 (Bug 10364) 27785bd8deadSopenharmony_ci - require EXT_shader_io_blocks 27795bd8deadSopenharmony_ci - add optional EXT_tessellation_point_size extension 27805bd8deadSopenharmony_ci - various minor editorial changes 27815bd8deadSopenharmony_ci 27825bd8deadSopenharmony_ci 4 11/28/13 dkoch Minor updates 27835bd8deadSopenharmony_ci - Added missing TESS_*_BIT_EXT to overview. 27845bd8deadSopenharmony_ci - Explicitly mention INVALID_ENUM errors as in GL 4.4. 27855bd8deadSopenharmony_ci - clarify that a PO or PPO using Tess needs a vertex shader (per GL 4.4). 27865bd8deadSopenharmony_ci - Add uniform matrix counting rule for TCS to match TES (per Issue 9). 27875bd8deadSopenharmony_ci - remove dangling reference to gl_VerticesOut. 27885bd8deadSopenharmony_ci - fix a couple remaining references to multiple shaders. 27895bd8deadSopenharmony_ci - fix a few typos, grammar and formatting issues. 27905bd8deadSopenharmony_ci - added interaction with OES_shader_multisample_interpolation. 27915bd8deadSopenharmony_ci 27925bd8deadSopenharmony_ci 3 11/20/13 Jon Leech Minor updates 27935bd8deadSopenharmony_ci - Refer to ES 3.1 instead of ES 3plus. 27945bd8deadSopenharmony_ci 27955bd8deadSopenharmony_ci 2 11/06/13 Jon Leech Updates based on Daniel Koch's feedback. 27965bd8deadSopenharmony_ci - Remove references from desktop language allowing multiple shader 27975bd8deadSopenharmony_ci objects per stage. 27985bd8deadSopenharmony_ci - Disallow multi-dimensional arrays as shader inputs & outputs, 27995bd8deadSopenharmony_ci consistent with OpenGL ES 3.1 and issue 7. 28005bd8deadSopenharmony_ci - Modified sections 4.3.4 / 4.3.6 to treat "centroid in" and "sample 28015bd8deadSopenharmony_ci in" as storage qualifiers on par with "in", in keeping with ESSL 28025bd8deadSopenharmony_ci 3.00 not having yet refactored storage qualifiers as GLSL 4.40 has 28035bd8deadSopenharmony_ci already done. Reverted input / output matching to require matches 28045bd8deadSopenharmony_ci in everything except in/out and precision, also based on ESSL 28055bd8deadSopenharmony_ci 3.00. Add "sample in" / "sample out" from 28065bd8deadSopenharmony_ci OES_shader_multisample_interpolation. 28075bd8deadSopenharmony_ci 28085bd8deadSopenharmony_ci 1 11/03/13 Jon Leech Initial version based on ARB_tessellation_shader. 2809