John Kessenich | 94a81fb | 2013-08-31 02:41:30 +0000 | [diff] [blame] | 1 | Current functionality level: ESSL 3.0 |
John Kessenich | 9fd55bd | 2012-12-13 00:05:26 +0000 | [diff] [blame] | 2 | |
John Kessenich | b603f91 | 2013-08-29 00:39:25 +0000 | [diff] [blame] | 3 | Link Validation |
John Kessenich | 05a7063 | 2013-09-17 19:26:08 +0000 | [diff] [blame] | 4 | + provide input config file for setting limits |
| 5 | - also consider spitting out measures of complexity |
John Kessenich | f5ebfb5 | 2013-09-20 06:20:21 +0000 | [diff] [blame^] | 6 | + ensure no static references thrown away |
John Kessenich | b603f91 | 2013-08-29 00:39:25 +0000 | [diff] [blame] | 7 | Cross-stage linking |
| 8 | - type consistency check of uniform and ins <-> outs, both variables and blocks, stage-specific arrayness matching |
| 9 | - location/binding/index check |
| 10 | - matching initializers for uniforms |
| 11 | - mixed es/non-es profiles |
| 12 | - statically consumed input not produced by previous stage |
| 13 | - matching between gl_PerVertex blocks and gl_PerFragment blocks |
| 14 | - compute shader not with other stages |
| 15 | - 1.3: deprecated mixing fixed vertex/fragment stage with programmable fragment/vertex stage. |
| 16 | - 4.3: remove cross-version linking restrictions. |
| 17 | - 4.3: Allow mismatches in interpolation and auxiliary qualification across stages. |
John Kessenich | 05a7063 | 2013-09-17 19:26:08 +0000 | [diff] [blame] | 18 | - 4.4: A stage contains two different blocks, each with no instance name, where the blocks contain a member with the same name. |
John Kessenich | b603f91 | 2013-08-29 00:39:25 +0000 | [diff] [blame] | 19 | Intra-stage linking |
| 20 | - exactly one main |
| 21 | - type consistency check of uniforms, globals, ins, and outs, both variables and blocks |
John Kessenich | 38f3b89 | 2013-09-06 19:52:57 +0000 | [diff] [blame] | 22 | - value checking of global const initializers |
| 23 | - value checking of uniform initializers |
John Kessenich | b603f91 | 2013-08-29 00:39:25 +0000 | [diff] [blame] | 24 | - location/component/binding/index/offset match check |
| 25 | - location/component aliasing (except desktop vertex shader inputs) |
John Kessenich | 94a81fb | 2013-08-31 02:41:30 +0000 | [diff] [blame] | 26 | - location layout range/overlap semantics |
John Kessenich | b603f91 | 2013-08-29 00:39:25 +0000 | [diff] [blame] | 27 | - geometry shader input array sizes and input layout qualifier declaration |
| 28 | - compute shader layout(local_size_*) matching |
| 29 | - mixed es/non-es profiles |
| 30 | - matching initializers for globals |
| 31 | - recursion for both functions and subroutines |
| 32 | - Even the potential for recursion through subroutine uniforms is an error. |
| 33 | - matching redeclarations of interface blocks |
| 34 | - read or write to both gl_ClipVertex and gl_ClipDistance |
| 35 | - write to only one of gl_FragColor, gl_FragData, or user-declared |
| 36 | - 4.3: Be clear that early_fragment_tests is only needed in one fragment-stage compilation unit. |
| 37 | - 4.3: Be clear that implicit array sizing is only within a stage, not cross stage. |
| 38 | - 4.4: overlapping transform/feedback offsets, offset/stride overflow checks, and stride matching |
John Kessenich | 05a7063 | 2013-09-17 19:26:08 +0000 | [diff] [blame] | 39 | - 4.4: If gl_FragCoord is redeclared in any fragment shader in a program, it must be redeclared in all the fragment shaders in that program that have a static use gl_FragCoord |
| 40 | - 4.4: An interface contains two different blocks, each with no instance name, where the blocks contain a member with the same name. |
John Kessenich | d46b31f | 2013-08-27 03:59:04 +0000 | [diff] [blame] | 41 | |
John Kessenich | b603f91 | 2013-08-29 00:39:25 +0000 | [diff] [blame] | 42 | Shader Functionality to Implement/Finish |
John Kessenich | 54f6e56 | 2013-08-03 00:04:10 +0000 | [diff] [blame] | 43 | ESSL 3.0 |
| 44 | - "const" compile-time constant propagation in the front-end has to be complete, for all built-in functions |
John Kessenich | fb4a0b6 | 2013-07-09 23:57:13 +0000 | [diff] [blame] | 45 | GLSL 1.2 |
| 46 | - Handle multiple compilation units per stage |
John Kessenich | b603f91 | 2013-08-29 00:39:25 +0000 | [diff] [blame] | 47 | - Allow initializers on uniform declarations |
John Kessenich | fb4a0b6 | 2013-07-09 23:57:13 +0000 | [diff] [blame] | 48 | - signature matching takes type conversions into account, ambiguity is an error |
| 49 | GLSL 1.3 |
| 50 | . flat is for both user and predeclared built-in in/out variables |
| 51 | GLSL 1.3 (Non-ES) |
| 52 | - Preprocessor token pasting (##), ## does macro expansion after pasting not before |
| 53 | - non-perspective (linear) interpolation (noperspective) |
| 54 | - add gl_ClipDistance[] to both vertex and fragment shaders |
| 55 | - only statically used built-ins have to be redeclared as flat |
John Kessenich | fb4a0b6 | 2013-07-09 23:57:13 +0000 | [diff] [blame] | 56 | - Deprecated gl_ClipVertex |
| 57 | - deprecate almost all built-in state |
| 58 | - ftransform() is deprecated |
| 59 | - Deprecated built-in vertex inputs (attributes) and some outputs (varyings). |
| 60 | GLSL 1.4 (Non-ES) |
| 61 | - track as removed in this release, but present in others: |
| 62 | - Use of gl_ClipVertex. Use gl_ClipDistance instead. |
| 63 | - Built-in vertex shader inputs. |
| 64 | - Built-in uniforms except for depth range parameters |
| 65 | - Built-in interface between vertex and fragment: gl_TexCoord, gl_FogFragCoord, and all the color values. |
| 66 | - Built-in two-sided coloring. |
| 67 | - Fixed functionality for a programmable stage. Supply shaders for all stages currently being used. |
| 68 | - ftransform(). Use invariant outputs instead. |
| 69 | GLSL 1.5 (Non-ES) |
| 70 | - Deprecated gl_MaxVaryingComponents |
| 71 | - Add new minimum maximums for gl_MaxVertexOutputComponents, gl_MaxGeometryInputComponents, gl_MaxGeometryOutputComponents, and gl_MaxFragmentInputComponents, |
| 72 | rather than relying on gl_MaxVaryingComponents. Also, corrected gl_MaxVaryingComponents to be 60 instead of 64. |
| 73 | - Added gl_PrimitiveID as an input to fragment shaders. |
| 74 | - Added gl_FragCoord qualifiers origin_upper_left, and pixel_center_integer to modify the values returned by gl_FragCoord (and have no affect on any other aspect of the pipeline or language). |
John Kessenich | b603f91 | 2013-08-29 00:39:25 +0000 | [diff] [blame] | 75 | - including redeclaration of gl_FragCoord that adds nothing |
John Kessenich | fb4a0b6 | 2013-07-09 23:57:13 +0000 | [diff] [blame] | 76 | - Added support for multi-sample textures through sampler2DMS and sampler2DMSArray support in texelFetch() and textureSize(). |
| 77 | - Broadened interface blocks from just uniforms to in and out interfaces as well. |
| 78 | - Broaden array usage to include vertex shader inputs (vertex in). |
| 79 | - Added geometry shaders. This includes targeting layers in FBO rendering. |
| 80 | - geometry shader layouts: they must be declared, telling the system the primitive input and output types and maximum number of vertices. |
| 81 | - Added geometry shader constants. |
John Kessenich | fb4a0b6 | 2013-07-09 23:57:13 +0000 | [diff] [blame] | 82 | - Broaden structure usage to include geometry inputs and geometry outputs. |
| 83 | GLSL 4.0 |
John Kessenich | d46b31f | 2013-08-27 03:59:04 +0000 | [diff] [blame] | 84 | - tessellation control stage and tessellation evaluation stage. Includes barrier() built-in for synchronization. |
| 85 | - Polymorphic functions: Run-time selection of what function gets called, through the new keyword subroutine. |
| 86 | - 64bit floating point numbers with the new type keyword double. Built-in functions extended for doubles, and new function matching rules are added to both allow implicit conversions when calling a function and preserve most existing function matching once doubles are included. |
| 87 | + More implicit conversions |
| 88 | + float to double, and similarly for all floating-point vector and matrix types |
| 89 | + int to uint, and similarly for all integer vector types |
| 90 | + int to double, and similarly for all vectors of integers and doubles. |
| 91 | + uint to double, and similarly for all vectors of integers and doubles. |
| 92 | - Cube map array textures and texture functions texture(), textureSize(), textureLod(), and textureGrad(). |
| 93 | - Sampler arrays can take a variable index now, as long as it's value is uniform for all uses. |
| 94 | - Per-sample shading. Including sample input mask gl_SampleMaskIn[] and per-sample interpolation, with explicit interpolation built-ins interpolateAtCentroid(), interpolateAtSample(), and interpolateAtOffset(). |
| 95 | - New precise qualifier to disallow optimizations that re-order operations or treat different instances of the same operator with different precision. |
John Kessenich | b603f91 | 2013-08-29 00:39:25 +0000 | [diff] [blame] | 96 | - Add a fused multiply and add built-in, fma(), in relation to the new precise qualifier. (Because a * b + c will require two operations under new rules for precise.) |
John Kessenich | d46b31f | 2013-08-27 03:59:04 +0000 | [diff] [blame] | 97 | - Added new built-in floating-point functions |
| 98 | - frexp() and ldexp() |
| 99 | - packUnorm2x16(), packUnorm4x8(),packSnorm4x8(), and packDouble2x32() |
| 100 | - unpackUnorm2x16(), unpackUnorm4x8(),unpackSnorm4x8(), and unpackDouble2x32() |
| 101 | - Add new built-in integer functions |
| 102 | - uaddCarry() andusubBorrow() |
| 103 | - umulExtended() andimulExtended() |
| 104 | - bitfieldExtract() andbitfieldInsert() |
| 105 | - bitfieldReverse() |
| 106 | - bitCount(),findLSB(), andfindMSB() |
| 107 | - New built-in to query LOD, textureQueryLod(). |
| 108 | - New overloaded function matching algorithm, handling selection from many valid multiple choices. |
| 109 | - Texture gather functions that return four texels with a single call. |
| 110 | - textureGather() |
| 111 | - textureGatherOffset() |
| 112 | - textureGatherOffsets() |
| 113 | - Add streams out from geometry shader. Output can be directed to streams through |
| 114 | - EmitStreamVertex() and EndStreamPrimitive(). |
John Kessenich | fb4a0b6 | 2013-07-09 23:57:13 +0000 | [diff] [blame] | 115 | GLSL 4.1 |
John Kessenich | d46b31f | 2013-08-27 03:59:04 +0000 | [diff] [blame] | 116 | - Support for partitioning shaders into multiple programs to provide light-weight mixing of different shader stages. |
| 117 | (GL_ARB_separate_shader_objects) |
John Kessenich | b603f91 | 2013-08-29 00:39:25 +0000 | [diff] [blame] | 118 | - layout qualifiers |
| 119 | - redeclaration of input/output blocks |
| 120 | - ... |
John Kessenich | d46b31f | 2013-08-27 03:59:04 +0000 | [diff] [blame] | 121 | - Add 64-bit floating-point attributes for vertex shader inputs. |
| 122 | - Support viewport arrays so where the geometry shader selects which viewport array will transform its output. |
John Kessenich | fb4a0b6 | 2013-07-09 23:57:13 +0000 | [diff] [blame] | 123 | GLSL 4.2 |
John Kessenich | d46b31f | 2013-08-27 03:59:04 +0000 | [diff] [blame] | 124 | + Move these previously deprecated features to be only in the compatibility profile: |
| 125 | + The keyword attribute for vertex shader inputs. (Use in instead.) |
| 126 | + The keyword varying for inputs and outputs. (Use in and out instead.) |
| 127 | + The original texturing built-in functions. (Use the new forms instead.) |
| 128 | + The built-in variables gl_FragColor and gl_FragData. (Use out instead.) |
| 129 | + Built-in constants related to these. |
| 130 | + Change from ASCII to UTF-8 for the language character set and also allow any characters inside comments (except the byte value 0), |
John Kessenich | b603f91 | 2013-08-29 00:39:25 +0000 | [diff] [blame] | 131 | including '\'. |
John Kessenich | d46b31f | 2013-08-27 03:59:04 +0000 | [diff] [blame] | 132 | + Add line-continuation using '\', as in C++. |
| 133 | + ES convergence |
| 134 | + Clarify that .xyzwxy.xy is illegal, as it temporarily makes a vec6. |
| 135 | + Clarify that return statements only accept values (no return of a void function). |
| 136 | - Add image types (GL_ARB_shader_image_load_store) |
| 137 | + 33 new types, all with image in their name, correspond to the non-shadow texture types |
| 138 | + addition of memory qualifiers: coherent,volatile, restrict, readonly, and writeonly |
| 139 | - can read/write/modify images from a shader, through new built-in functions |
| 140 | - qualifiers can act independently on the opaque shader variable and the backing image, so extra qualifiers can be used to separately qualify these |
| 141 | + Variables declared in if and else statements are scoped only to the end of those statements, especially for non-compound statements |
John Kessenich | b603f91 | 2013-08-29 00:39:25 +0000 | [diff] [blame] | 142 | Note, this is not backward compatible, it may depend on #version. |
John Kessenich | d46b31f | 2013-08-27 03:59:04 +0000 | [diff] [blame] | 143 | - Allow implicit conversions of return values to the declared type of the function. |
| 144 | - The const keyword can be used to declare variables within a function body with initializer expressions that are not constant expressions. |
| 145 | + Qualifiers on variable declarations no longer have to follow a strict order. The layout qualifier can be used multiple times, and multiple parameter qualifiers can be used. |
| 146 | + Parameter qualifiers can include precision and memory qualifiers. |
| 147 | - Add a new atomic_uint type to support atomic counters. Also, add built-in functions for manipulating atomic counters. |
| 148 | - atomicCounterIncrement, atomicCounterDecrement, and atomicCounter |
| 149 | - Add layout qualifier identifiers binding and offset to bind units to sampler and image variable declarations, atomic counters, and uniform blocks. |
| 150 | - Add built-in functions to pack/unpack 16 bit floating-point numbers (ARB_shading_language_pack2f). |
| 151 | - packHalf2x16 and unpackHalf2x16 |
| 152 | - packSnorm2x16and unpackSnorm2x16 |
| 153 | - Add gl_FragDepthlayout qualifiers to communicate what kind of changes will be made to gl_FragDepth(GL_AMD_conservative depth). |
| 154 | - Add C-style curly brace initializer lists syntax for initializers. Full initialization of aggregates is required when these are used. |
| 155 | - Allow .length() to be applied to vectors and matrices, returning the number of components or columns. |
| 156 | + Clarify that .length() returns an int type and can be used as a constant integer expression. |
| 157 | - Allow swizzle operations on scalars. |
John Kessenich | d46b31f | 2013-08-27 03:59:04 +0000 | [diff] [blame] | 158 | - Positive signed decimal literals, as well as octal and hexadecimal, can set all 32 bits. This includes setting the sign bit to create a negative value. |
| 159 | - Make GLSL consistent with the API regarding user clipping, by no longer referring to gl_Positionwhen gl_ClipVertex is not written. Rather, user clipping becomes undefined. |
John Kessenich | 05a7063 | 2013-09-17 19:26:08 +0000 | [diff] [blame] | 160 | - Clarified that a comma sequence-operator expression cannot be a constant expression. E.g., (2,3) is not allowed, semantically, as a valid constant expression 3, even though it is an expression that will evaluate to 3. |
| 161 | - Use vec2 instead of vec3 for coordinate in textureGather*(sampler2DRect,...). |
| 162 | - Clarify that textureGatherOffset() can take non-constants for the offsets. |
John Kessenich | fb4a0b6 | 2013-07-09 23:57:13 +0000 | [diff] [blame] | 163 | GLSL 4.3 |
John Kessenich | d46b31f | 2013-08-27 03:59:04 +0000 | [diff] [blame] | 164 | - Add shader storage bufferobjects, as per the ARB_shader_storage_buffer_object extension. |
| 165 | This includes 1) allowing the last member of a storage buffer block to be an array that does not |
| 166 | know its size until render time, and 2) read/write memory shared with the application and other |
| 167 | shader invocations. It also adds the std430layout qualifier for shader storage blocks. |
| 168 | - Allow .length() on all arrays; returning a compile-time constant or not, depending on how the |
| 169 | array is sized, as per the ARB_shader_storage_buffer_object extension. |
| 170 | - Be clear that implicit array sizing is only within a stage, not cross stage. |
| 171 | - Array clarifications: 1) All arrays are inherently homogeneous, except for arrays of the new |
| 172 | shader storage buffer objects. 2) Arrays of shader storage buffer objects will be dereferenced |
| 173 | when the .length() method is used on an unsized array member, so that must a have valid index. |
| 174 | 3) Arrays of other objects (uniform blocks) containing implicitly sized arrays will have the same |
| 175 | implicit size for all elements of the array. |
| 176 | - Arrays of arrays are now supported, as per the GL_ARB_arrays_of_arraysextension. |
| 177 | - Compute shaders are now supported, as per the GL_ARB_compute_shader extension. |
| 178 | - Added imageSize() built-ins to query the dimensions of an image. |
| 179 | - Define robust out-of-bounds access behavior when enabled, as per the GL_ARB_robust_buffer_access_behavior extension. |
| 180 | - All choice of depth or stencil texturing, for a packed depth-stencil texture, as per the |
| 181 | GL_ARB_stencil_texturing extension. |
| 182 | - Allow explicit locations/indexes to be assigned to uniform variables and subroutines, as per the |
| 183 | GL_ARB_explicit_uniform_location extension. |
| 184 | - Accept ES GLSL shader #version statements, which will request ES functionality for ES GLSL |
| 185 | versions 100 and 300, as per the GL_ARB_ES3_compatibility extension. |
John Kessenich | d46b31f | 2013-08-27 03:59:04 +0000 | [diff] [blame] | 186 | - Clarify and correct scoping rules to what would normally be expected and what was intended. |
| 187 | (Function parameters and body nest inside global space. Loop variables and body nest inside |
| 188 | loop scope.) |
| 189 | - There are no digraphs (trigraphs were already disallowed). |
| 190 | - Remove the CPP difference that it is a compile-time error to use #if or #elif on expressions |
| 191 | containing undefined macro names. This reverts back to following expected CPP behavior. |
John Kessenich | b603f91 | 2013-08-29 00:39:25 +0000 | [diff] [blame] | 192 | - Set both gl_MaxFragmentImageUniformsand gl_MaxCombinedImageUniforms to 8. |
John Kessenich | d46b31f | 2013-08-27 03:59:04 +0000 | [diff] [blame] | 193 | - Clarify textureSize() for cube map arrays. |
| 194 | - For layout qualifiers, |
| 195 | - make negative output locations a compile-time error, and |
| 196 | - make indexes outside the range [0,1] a compile-time error. |
John Kessenich | d46b31f | 2013-08-27 03:59:04 +0000 | [diff] [blame] | 197 | - Add textureQueryLevels() built-ins to query the number of mipmap levels, as per the |
| 198 | GL_ARB_texture_query_levels extension. |
| 199 | - Make gl_Layer and gl_ViewportIndex also be inputs to the fragment shader, as per the |
| 200 | GL_ARB_fragment_layer_viewport extension. |
John Kessenich | d46b31f | 2013-08-27 03:59:04 +0000 | [diff] [blame] | 201 | - Add more examples and rules to be more specific about the required behavior of the precise |
| 202 | qualifier. |
| 203 | - Clarify fragment output variables cannot be double precision. |
John Kessenich | d46b31f | 2013-08-27 03:59:04 +0000 | [diff] [blame] | 204 | - Allow the new shared keyword to be in layout-qualifier-id, allowing backward compatibility |
| 205 | with the shared identifier that was previously used. |
| 206 | + Added overlooked texture function float textureOffset (sampler2DArrayShadow sampler, vec4 P, vec2 offset [, float bias] ). |
| 207 | + Add missing type in grammar, ATOMIC_UINT, and missing qualifiers COHERENT, VOLATILE, RESTRICT, READONLY, and WRITEONLY. |
John Kessenich | b603f91 | 2013-08-29 00:39:25 +0000 | [diff] [blame] | 208 | - do version checking for the above |
John Kessenich | d46b31f | 2013-08-27 03:59:04 +0000 | [diff] [blame] | 209 | + Add missing initializer lists to grammar. |
John Kessenich | fb4a0b6 | 2013-07-09 23:57:13 +0000 | [diff] [blame] | 210 | GLSL 4.4 |
John Kessenich | d46b31f | 2013-08-27 03:59:04 +0000 | [diff] [blame] | 211 | - Incorporate the ARB_enhanced_layouts extension, which adds |
| 212 | - compile-time constant expressions for layout qualifier integers |
| 213 | - new offset and align layout qualifiers for control over buffer block layouts |
| 214 | - add location layout qualifier for input and output blocks and block members |
| 215 | - new componentlayout qualifier for finer-grained layout control of input and output variables and blocks |
| 216 | - new xfb_buffer, xfb_stride, and xfb_offsetlayout qualifiers to allow the shader to control |
| 217 | transform feedback buffering. |
| 218 | + Bug 10530: To be consistent with ES, include sample types as valid in a precision statement. |
| 219 | Note the defaults are irrelevant, as precision qualifiers are not required or have any meaning. |