blob: a82851d6bc318f1b177e06850b60f124889d0cc2 [file] [log] [blame]
John Kessenich94a81fb2013-08-31 02:41:30 +00001Current functionality level: ESSL 3.0
John Kessenich9fd55bd2012-12-13 00:05:26 +00002
John Kessenichb603f912013-08-29 00:39:25 +00003Link Validation
John Kessenich05a70632013-09-17 19:26:08 +00004 + provide input config file for setting limits
5 - also consider spitting out measures of complexity
John Kessenichf5ebfb52013-09-20 06:20:21 +00006 + ensure no static references thrown away
John Kessenich9839e242013-09-26 00:45:21 +00007 - generate static use of object even if the only use is to access the length of its array
John Kessenichb603f912013-08-29 00:39:25 +00008 Cross-stage linking
9 - type consistency check of uniform and ins <-> outs, both variables and blocks, stage-specific arrayness matching
10 - location/binding/index check
John Kessenichb603f912013-08-29 00:39:25 +000011 - mixed es/non-es profiles
12 - statically consumed input not produced by previous stage
John Kessenich337dbc72013-09-24 21:18:46 +000013 - give error for sharing a packed block
John Kessenichfb57e7c2013-10-15 21:46:20 +000014 - 1.2: matching initializers for uniforms
15 - 1.5: matching between gl_PerVertex blocks and gl_PerFragment blocks
John Kessenichb603f912013-08-29 00:39:25 +000016 - 1.3: deprecated mixing fixed vertex/fragment stage with programmable fragment/vertex stage.
John Kessenichfb57e7c2013-10-15 21:46:20 +000017 - 4.3: compute shader not combined with any other stages
John Kessenichb603f912013-08-29 00:39:25 +000018 - 4.3: remove cross-version linking restrictions.
19 - 4.3: Allow mismatches in interpolation and auxiliary qualification across stages.
John Kessenich05a70632013-09-17 19:26:08 +000020 - 4.4: A stage contains two different blocks, each with no instance name, where the blocks contain a member with the same name.
John Kessenichb603f912013-08-29 00:39:25 +000021 Intra-stage linking
John Kessenichfb57e7c2013-10-15 21:46:20 +000022 - ES 3.0: location aliasing/overlap (except desktop vertex shader inputs)
23 + ES 3.0: fragment outputs all have locations, if more than one
John Kessenich337dbc72013-09-24 21:18:46 +000024 + exactly one main
John Kessenich2ecdd142013-10-01 21:58:43 +000025 + Non ES: type consistency check of uniforms, globals, ins, and outs
26 + Non ES: value checking of global const initializers
27 + Non ES: value checking of uniform initializers
28 + Non ES: location match
John Kessenichfb57e7c2013-10-15 21:46:20 +000029 - Non ES: gl_TexCoord can only have a max array size of up to gl_MaxTextureCoords
John Kessenich2ecdd142013-10-01 21:58:43 +000030 + recursion for functions
31 - Non ES: block matching
32 - Non ES: component/binding/index/offset match check
33 - Non ES: geometry shader input array sizes and input layout qualifier declaration
34 - Non ES: compute shader layout(local_size_*) matching
35 + mixed es/non-es profiles are an error
36 - Non ES: Even the potential for recursion through subroutine uniforms is an error.
37 - Non ES: matching redeclarations of interface blocks
38 - Non ES: read or write to both gl_ClipVertex and gl_ClipDistance
39 - Non ES: write to only one of gl_FragColor, gl_FragData, or user-declared
John Kessenichb603f912013-08-29 00:39:25 +000040 - 4.3: Be clear that early_fragment_tests is only needed in one fragment-stage compilation unit.
41 - 4.3: Be clear that implicit array sizing is only within a stage, not cross stage.
42 - 4.4: overlapping transform/feedback offsets, offset/stride overflow checks, and stride matching
John Kessenich05a70632013-09-17 19:26:08 +000043 - 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
44 - 4.4: An interface contains two different blocks, each with no instance name, where the blocks contain a member with the same name.
John Kessenich2ecdd142013-10-01 21:58:43 +000045 - 4.4: component aliasing (except desktop vertex shader inputs)
John Kessenichd46b31f2013-08-27 03:59:04 +000046
John Kessenichb603f912013-08-29 00:39:25 +000047Shader Functionality to Implement/Finish
John Kessenicha5830df2013-10-02 05:10:48 +000048 ESSL 2.0 (#version 100)
John Kessenichfb57e7c2013-10-15 21:46:20 +000049 + implement non-inductive loop limitation detection
50 + implement non-inductive array accesses limitation detection
John Kessenich54f6e562013-08-03 00:04:10 +000051 ESSL 3.0
52 - "const" compile-time constant propagation in the front-end has to be complete, for all built-in functions
John Kessenichfb4a0b62013-07-09 23:57:13 +000053 GLSL 1.2
John Kessenicha5830df2013-10-02 05:10:48 +000054 + Handle multiple compilation units per stage
55 + Allow initializers on uniform declarations
John Kessenichfb4a0b62013-07-09 23:57:13 +000056 - signature matching takes type conversions into account, ambiguity is an error
John Kessenich8d8f4cc2013-10-18 03:09:37 +000057 - all constructors to contain non-dereferenced arrays?
John Kessenichfb4a0b62013-07-09 23:57:13 +000058 GLSL 1.3
59 . flat is for both user and predeclared built-in in/out variables
60 GLSL 1.3 (Non-ES)
61 - Preprocessor token pasting (##), ## does macro expansion after pasting not before
62 - non-perspective (linear) interpolation (noperspective)
John Kessenich8f13e132013-10-18 03:56:23 +000063 + add gl_ClipDistance[] to both vertex and fragment shaders
John Kessenichfb4a0b62013-07-09 23:57:13 +000064 - only statically used built-ins have to be redeclared as flat
John Kessenich8f13e132013-10-18 03:56:23 +000065 + Deprecated gl_ClipVertex
66 + deprecate almost all built-in state
67 + ftransform() is deprecated
68 + Deprecated built-in vertex inputs (attributes) and some outputs (varyings).
John Kessenichfb4a0b62013-07-09 23:57:13 +000069 GLSL 1.4 (Non-ES)
John Kessenich8f13e132013-10-18 03:56:23 +000070 + track as removed in this release, but present in others:
71 + Use of gl_ClipVertex. Use gl_ClipDistance instead.
72 + Built-in vertex shader inputs.
73 + Built-in uniforms except for depth range parameters
74 + Built-in interface between vertex and fragment: gl_TexCoord, gl_FogFragCoord, and all the color values.
75 + Built-in two-sided coloring.
76 + Fixed functionality for a programmable stage.
77 + ftransform(). Use invariant outputs instead.
John Kessenichfb4a0b62013-07-09 23:57:13 +000078 GLSL 1.5 (Non-ES)
79 - Deprecated gl_MaxVaryingComponents
80 - Add new minimum maximums for gl_MaxVertexOutputComponents, gl_MaxGeometryInputComponents, gl_MaxGeometryOutputComponents, and gl_MaxFragmentInputComponents,
81 rather than relying on gl_MaxVaryingComponents. Also, corrected gl_MaxVaryingComponents to be 60 instead of 64.
John Kessenich8f13e132013-10-18 03:56:23 +000082 + Added gl_PrimitiveID as an input to fragment shaders.
John Kessenichfb4a0b62013-07-09 23:57:13 +000083 - 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 Kessenichb603f912013-08-29 00:39:25 +000084 - including redeclaration of gl_FragCoord that adds nothing
John Kessenichfb4a0b62013-07-09 23:57:13 +000085 - Added support for multi-sample textures through sampler2DMS and sampler2DMSArray support in texelFetch() and textureSize().
John Kessenich8f13e132013-10-18 03:56:23 +000086 + Broadened interface blocks from just uniforms to in and out interfaces as well.
87 + Broaden array usage to include vertex shader inputs (vertex in).
John Kessenichfb4a0b62013-07-09 23:57:13 +000088 - Added geometry shaders. This includes targeting layers in FBO rendering.
89 - geometry shader layouts: they must be declared, telling the system the primitive input and output types and maximum number of vertices.
90 - Added geometry shader constants.
John Kessenichfb4a0b62013-07-09 23:57:13 +000091 - Broaden structure usage to include geometry inputs and geometry outputs.
92 GLSL 4.0
John Kessenichd46b31f2013-08-27 03:59:04 +000093 - tessellation control stage and tessellation evaluation stage. Includes barrier() built-in for synchronization.
94 - Polymorphic functions: Run-time selection of what function gets called, through the new keyword subroutine.
95 - 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.
96 + More implicit conversions
97 + float to double, and similarly for all floating-point vector and matrix types
98 + int to uint, and similarly for all integer vector types
99 + int to double, and similarly for all vectors of integers and doubles.
100 + uint to double, and similarly for all vectors of integers and doubles.
101 - Cube map array textures and texture functions texture(), textureSize(), textureLod(), and textureGrad().
102 - Sampler arrays can take a variable index now, as long as it's value is uniform for all uses.
103 - Per-sample shading. Including sample input mask gl_SampleMaskIn[] and per-sample interpolation, with explicit interpolation built-ins interpolateAtCentroid(), interpolateAtSample(), and interpolateAtOffset().
104 - New precise qualifier to disallow optimizations that re-order operations or treat different instances of the same operator with different precision.
John Kessenichb603f912013-08-29 00:39:25 +0000105 - 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 Kessenichd46b31f2013-08-27 03:59:04 +0000106 - Added new built-in floating-point functions
107 - frexp() and ldexp()
108 - packUnorm2x16(), packUnorm4x8(),packSnorm4x8(), and packDouble2x32()
109 - unpackUnorm2x16(), unpackUnorm4x8(),unpackSnorm4x8(), and unpackDouble2x32()
110 - Add new built-in integer functions
111 - uaddCarry() andusubBorrow()
112 - umulExtended() andimulExtended()
113 - bitfieldExtract() andbitfieldInsert()
114 - bitfieldReverse()
115 - bitCount(),findLSB(), andfindMSB()
116 - New built-in to query LOD, textureQueryLod().
117 - New overloaded function matching algorithm, handling selection from many valid multiple choices.
118 - Texture gather functions that return four texels with a single call.
119 - textureGather()
120 - textureGatherOffset()
121 - textureGatherOffsets()
John Kessenich8f13e132013-10-18 03:56:23 +0000122 + Add streams out from geometry shader. Output can be directed to streams through
123 + EmitStreamVertex() and EndStreamPrimitive().
John Kessenichfb4a0b62013-07-09 23:57:13 +0000124 GLSL 4.1
John Kessenichd46b31f2013-08-27 03:59:04 +0000125 - Support for partitioning shaders into multiple programs to provide light-weight mixing of different shader stages.
126 (GL_ARB_separate_shader_objects)
John Kessenichb603f912013-08-29 00:39:25 +0000127 - layout qualifiers
128 - redeclaration of input/output blocks
129 - ...
John Kessenichd46b31f2013-08-27 03:59:04 +0000130 - Add 64-bit floating-point attributes for vertex shader inputs.
131 - Support viewport arrays so where the geometry shader selects which viewport array will transform its output.
John Kessenichfb4a0b62013-07-09 23:57:13 +0000132 GLSL 4.2
John Kessenichd46b31f2013-08-27 03:59:04 +0000133 + Move these previously deprecated features to be only in the compatibility profile:
134 + The keyword attribute for vertex shader inputs. (Use in instead.)
135 + The keyword varying for inputs and outputs. (Use in and out instead.)
136 + The original texturing built-in functions. (Use the new forms instead.)
137 + The built-in variables gl_FragColor and gl_FragData. (Use out instead.)
138 + Built-in constants related to these.
139 + Change from ASCII to UTF-8 for the language character set and also allow any characters inside comments (except the byte value 0),
John Kessenichb603f912013-08-29 00:39:25 +0000140 including '\'.
John Kessenichd46b31f2013-08-27 03:59:04 +0000141 + Add line-continuation using '\', as in C++.
142 + ES convergence
143 + Clarify that .xyzwxy.xy is illegal, as it temporarily makes a “vec6”.
144 + Clarify that return statements only accept values (no return of a void function).
145 - Add image types (GL_ARB_shader_image_load_store)
146 + 33 new types, all with “image” in their name, correspond to the non-shadow texture types
147 + addition of memory qualifiers: coherent,volatile, restrict, readonly, and writeonly
148 - can read/write/modify images from a shader, through new built-in functions
149 - qualifiers can act independently on the opaque shader variable and the backing image, so extra qualifiers can be used to separately qualify these
150 + Variables declared in if and else statements are scoped only to the end of those statements, especially for non-compound statements
John Kessenichb603f912013-08-29 00:39:25 +0000151 Note, this is not backward compatible, it may depend on #version.
John Kessenichd46b31f2013-08-27 03:59:04 +0000152 - Allow implicit conversions of return values to the declared type of the function.
John Kessenich8f13e132013-10-18 03:56:23 +0000153 + The const keyword can be used to declare variables within a function body with initializer expressions that are not constant expressions.
John Kessenichd46b31f2013-08-27 03:59:04 +0000154 + 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.
155 + Parameter qualifiers can include precision and memory qualifiers.
156 - Add a new atomic_uint type to support atomic counters. Also, add built-in functions for manipulating atomic counters.
157 - atomicCounterIncrement, atomicCounterDecrement, and atomicCounter
158 - Add layout qualifier identifiers binding and offset to bind units to sampler and image variable declarations, atomic counters, and uniform blocks.
159 - Add built-in functions to pack/unpack 16 bit floating-point numbers (ARB_shading_language_pack2f).
160 - packHalf2x16 and unpackHalf2x16
161 - packSnorm2x16and unpackSnorm2x16
162 - Add gl_FragDepthlayout qualifiers to communicate what kind of changes will be made to gl_FragDepth(GL_AMD_conservative depth).
John Kessenich8f13e132013-10-18 03:56:23 +0000163 + Add C-style curly brace initializer lists syntax for initializers. Full initialization of aggregates is required when these are used.
John Kessenichd46b31f2013-08-27 03:59:04 +0000164 - Allow .length() to be applied to vectors and matrices, returning the number of components or columns.
165 + Clarify that .length() returns an int type and can be used as a constant integer expression.
John Kessenich8f13e132013-10-18 03:56:23 +0000166 + Allow swizzle operations on scalars.
John Kessenichd46b31f2013-08-27 03:59:04 +0000167 - 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.
John Kessenich8f13e132013-10-18 03:56:23 +0000168 - Make GLSL consistent with the API regarding user clipping, by no longer referring to gl_Position when gl_ClipVertex is not written. Rather, user clipping becomes undefined.
John Kessenich61c2d142013-10-03 20:23:57 +0000169 - Clarified that a comma sequence-operator expression cannot be a constant expression. E.g., “(2,3)” is not allowed, semantically,
170 as a valid constant expression 3, even though it is an expression that will evaluate to 3.
John Kessenich05a70632013-09-17 19:26:08 +0000171 - Use vec2 instead of vec3 for coordinate in textureGather*(sampler2DRect,...).
172 - Clarify that textureGatherOffset() can take non-constants for the offsets.
John Kessenichfb4a0b62013-07-09 23:57:13 +0000173 GLSL 4.3
John Kessenich61c2d142013-10-03 20:23:57 +0000174 - Add shader storage buffer objects, as per the ARB_shader_storage_buffer_object extension. This includes
175 - allowing the last member of a storage buffer block to be an array that does not know its size until render time
176 - read/write memory shared with the application and other shader invocations
177 - adding the std430 layout qualifier for shader storage blocks
John Kessenichd46b31f2013-08-27 03:59:04 +0000178 - Allow .length() on all arrays; returning a compile-time constant or not, depending on how the
179 array is sized, as per the ARB_shader_storage_buffer_object extension.
180 - Be clear that implicit array sizing is only within a stage, not cross stage.
John Kessenich61c2d142013-10-03 20:23:57 +0000181 - Array clarifications:
182 - All arrays are inherently homogeneous, except for arrays of the new shader storage buffer objects
183 - Arrays of shader storage buffer objects will be dereferenced when the .length() method is used on an unsized array
184 member, so that must a have valid index.
185 - Arrays of other objects (uniform blocks) containing implicitly sized arrays will have the same implicit size for all
186 elements of the array.
John Kessenichd46b31f2013-08-27 03:59:04 +0000187 - Arrays of arrays are now supported, as per the GL_ARB_arrays_of_arraysextension.
188 - Compute shaders are now supported, as per the GL_ARB_compute_shader extension.
189 - Added imageSize() built-ins to query the dimensions of an image.
190 - Define robust out-of-bounds access behavior when enabled, as per the GL_ARB_robust_buffer_access_behavior extension.
191 - All choice of depth or stencil texturing, for a packed depth-stencil texture, as per the
192 GL_ARB_stencil_texturing extension.
193 - Allow explicit locations/indexes to be assigned to uniform variables and subroutines, as per the
194 GL_ARB_explicit_uniform_location extension.
195 - Accept ES GLSL shader #version statements, which will request ES functionality for ES GLSL
196 versions 100 and 300, as per the GL_ARB_ES3_compatibility extension.
John Kessenichd46b31f2013-08-27 03:59:04 +0000197 - Clarify and correct scoping rules to what would normally be expected and what was intended.
198 (Function parameters and body nest inside global space. Loop variables and body nest inside
199 loop scope.)
200 - There are no digraphs (trigraphs were already disallowed).
201 - Remove the CPP difference that it is a compile-time error to use #if or #elif on expressions
202 containing undefined macro names. This reverts back to following expected CPP behavior.
John Kessenichb603f912013-08-29 00:39:25 +0000203 - Set both gl_MaxFragmentImageUniformsand gl_MaxCombinedImageUniforms to 8.
John Kessenichd46b31f2013-08-27 03:59:04 +0000204 - Clarify textureSize() for cube map arrays.
205 - For layout qualifiers,
206 - make negative output locations a compile-time error, and
207 - make indexes outside the range [0,1] a compile-time error.
John Kessenichd46b31f2013-08-27 03:59:04 +0000208 - Add textureQueryLevels() built-ins to query the number of mipmap levels, as per the
209 GL_ARB_texture_query_levels extension.
210 - Make gl_Layer and gl_ViewportIndex also be inputs to the fragment shader, as per the
211 GL_ARB_fragment_layer_viewport extension.
John Kessenichd46b31f2013-08-27 03:59:04 +0000212 - Add more examples and rules to be more specific about the required behavior of the precise
213 qualifier.
214 - Clarify fragment output variables cannot be double precision.
John Kessenichd46b31f2013-08-27 03:59:04 +0000215 - Allow the new shared keyword to be in layout-qualifier-id, allowing backward compatibility
216 with the shared identifier that was previously used.
217 + Added overlooked texture function float textureOffset (sampler2DArrayShadow sampler, vec4 P, vec2 offset [, float bias] ).
218 + Add missing type in grammar, ATOMIC_UINT, and missing qualifiers COHERENT, VOLATILE, RESTRICT, READONLY, and WRITEONLY.
John Kessenichb603f912013-08-29 00:39:25 +0000219 - do version checking for the above
John Kessenichd46b31f2013-08-27 03:59:04 +0000220 + Add missing initializer lists to grammar.
John Kessenichfb4a0b62013-07-09 23:57:13 +0000221 GLSL 4.4
John Kessenichd46b31f2013-08-27 03:59:04 +0000222 - Incorporate the ARB_enhanced_layouts extension, which adds
223 - compile-time constant expressions for layout qualifier integers
224 - new offset and align layout qualifiers for control over buffer block layouts
225 - add location layout qualifier for input and output blocks and block members
226 - new componentlayout qualifier for finer-grained layout control of input and output variables and blocks
227 - new xfb_buffer, xfb_stride, and xfb_offsetlayout qualifiers to allow the shader to control
228 transform feedback buffering.
229 + Bug 10530: To be consistent with ES, include sample types as valid in a precision statement.
230 Note the defaults are irrelevant, as precision qualifiers are not required or have any meaning.