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