summaryrefslogtreecommitdiffstats
path: root/src/compiler/glsl/glsl_parser.yy
Commit message (Collapse)AuthorAgeFilesLines
* glsl: process local_size_variable input qualifierSamuel Pitoiset2016-10-071-0/+13
| | | | | | | | | | | | This is the new layout qualifier introduced by ARB_compute_variable_group_size which allows to use a variable work group size. v4: - add missing '%s' in the monster format string Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
* glsl: Handle patch qualifier on interface blocks.Kenneth Graunke2016-08-301-0/+11
| | | | | Signed-off-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
* glsl: Allow invocations layout qualifier with GL_OES_geometry_shaderIan Romanick2016-08-261-2/+4
| | | | | | | | | | | | | | | | | | | Fixes dEQP-GLES31.functional.geometry_shading.instanced.geometry_1_invocations dEQP-GLES31.functional.geometry_shading.instanced.invocation_per_layer_2d_array dEQP-GLES31.functional.geometry_shading.instanced.invocation_per_layer_2d_multisample_array dEQP-GLES31.functional.geometry_shading.instanced.invocation_per_layer_3d dEQP-GLES31.functional.geometry_shading.instanced.invocation_per_layer_cubemap dEQP-GLES31.functional.geometry_shading.instanced.multiple_layers_per_invocation_2d_array dEQP-GLES31.functional.geometry_shading.instanced.multiple_layers_per_invocation_2d_multisample_array dEQP-GLES31.functional.geometry_shading.instanced.multiple_layers_per_invocation_3d dEQP-GLES31.functional.geometry_shading.instanced.multiple_layers_per_invocation_cubemap dEQP-GLES31.functional.geometry_shading.query.geometry_shader_invocations Signed-off-by: Ian Romanick <ian.d.romanick@intel.com> Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
* glsl: process blend_support_* qualifiersIlia Mirkin2016-08-251-0/+45
| | | | | | | | | | v2 (Ken): Add a BLEND_NONE enum value (no qualifiers in use). v3 (Ken): Rename gl_blend_support_qualifier to gl_advanced_blend_mode. v4 (Ken): Mark map[] as static const (Ilia). Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Francisco Jerez <currojerez@riseup.net>
* glsl: Handle the inout qualifier in fragment shader output declarations.Francisco Jerez2016-08-241-0/+12
| | | | | | | | | | | | According to the EXT_shader_framebuffer_fetch extension the inout qualifier can be used on ESSL 3.0+ shaders to declare a special kind of fragment output that gets implicitly initialized with the previous framebuffer contents at the current fragment coordinates. In addition we allow using the same language to define FB fetch outputs in GLSL 1.3+ shaders in preparation for the desktop MESA_shader_framebuffer_fetch extensions. Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
* glsl: Mark tessellation qualifier maps static const.Kenneth Graunke2016-08-231-2/+2
| | | | | Signed-off-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
* glsl: Fix invariant matching in GLSL 4.30 and GLSL ES 1.00.Kenneth Graunke2016-08-111-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | Old languages (GLSL <= 4.20 and GLSL ES 1.00) require "invariant" to be specified on both inputs and outputs, and match when linking. New languages only allow outputs to be qualified as "invariant" and remove the "invariant must match" restriction when linking varyings (because no input can have that qualifier). Commit 426a50e2089b12d33f5c075aa5622f64076914a3 introduced the new behavior for ES 3.00. It also removed the "must match" restriction for ES 1.00 shaders, which I believe is incorrect. This patch adds that back, as well as making 4.30+ follow the new rules. Thanks to Qiankun Miao for noticing this discrepancy. Fixes a WebGL 2.0 conformance test when run in Chromium: https://www.khronos.org/registry/webgl/sdk/tests/deqp/data/gles3/shaders/qualification_order.html?webglVersion=2 Cc: mesa-stable@lists.freedesktop.org Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=96971 Signed-off-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Timothy Arceri <timothy.arceri@collabora.com>
* glsl: Add extension plumbing for OES/EXT_tessellation_shader.Kenneth Graunke2016-08-081-1/+2
| | | | | | | | This adds the #extension directive support, built-in #defines, lexer keyword support, and updates has_tessellation_shader(). Signed-off-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
* glsl: Simplify interface qualifier parsing.Kenneth Graunke2016-08-071-34/+7
| | | | | | | | This better matches the grammar in section 4.3.9 of the GLSL 4.5 spec, and also removes some redundant code. Signed-off-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Timothy Arceri <timothy.arceri@collabora.com>
* glsl: Add a has_tessellation_shader() helper.Kenneth Graunke2016-08-071-14/+5
| | | | | | | | Similar to has_geometry_shader(), has_compute_shader(), and so on. This will make it easier to add more conditions here later. Signed-off-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Timothy Arceri <timothy.arceri@collabora.com>
* glsl/parser: handle multiple layout sections with AST nodes.Dave Airlie2016-05-231-0/+2
| | | | | | | | | | | | | For geometry/compute inputs and tess control outputs, we create an AST node to keep track of some things. However if we have multiple layout sections, we don't ever link the node into the AST. This is because we create the node on the rightmost layout declaration and don't pass it back in so it gets linked at the end of the parsing of the rightmost. Reviewed-by: Timothy Arceri <timothy.arceri@collabora.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
* glsl: parse component layout qualifierTimothy Arceri2016-05-011-0/+11
| | | | | | Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com> Reviewed-by: Edward O'Callaghan <eocallaghan@alterapraxis.com> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
* glsl: parse new transform feedback layout qualifiersTimothy Arceri2016-03-311-0/+25
| | | | | | | | | | | | | | | | | | | | | | We reuse the existing offset field for holding the xfb_offset expression but create a new flag as to avoid hitting the rules for the offset qualifier for UBOs. xfb_buffer qualifiers require extra processing when merging as they can be applied to global out defaults. We just apply the same rules as we do for the stream qualifier as the spec says: "The *xfb_buffer* qualifier follows the same conventions, behavior, defaults, and inheritance rules as the qualifier stream, and the examples for stream apply here as well." For xfb_stride we push everything into a global out field for later processing as xfb_stride applies to the entire buffer. We still need to have a separate field to store per variable strides because they can still effect implicit offsets e.g. when applied to block members with implicit offsets. Reviewed-by: Dave Airlie <airlied@redhat.com>
* glsl: Add function parameters to the parser symbol table.Kenneth Graunke2016-03-071-0/+2
| | | | | | | | | | | | | | | | | | | In a shader such as: struct S { float f; } float identity(float S) { return S; } we would think that "S" in "return S" referred to a structure, even though it's shadowed by the "float S" parameter in the inner struct. This led to the parser's grammar seeing TYPE_IDENTIFIER and getting confused. Fixes dEQP-GLES2.functional.shaders.scoping.valid. function_parameter_hides_struct_type_{vertex,fragment}. Signed-off-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Timothy Arceri <timothy.arceri@collabora.com>
* glsl: Add single declaration variables to the symbol table too.Kenneth Graunke2016-03-071-0/+4
| | | | | | | | | | | | | | | | | | | | | | | The lexer/parser use a symbol table to classify identifiers as variables, functions, or structure types. For some reason, we neglected to add variables in simple declarations such as int x = 5; but did add subsequent variables in multi-declarations: int x = 5, y = 6; // y gets added, but not x, for some reason Fixes four dEQP-GLES2.functional.shaders.scoping.valid subcases: - local_int_variable_hides_struct_type_vertex - local_int_variable_hides_struct_type_fragment - local_struct_variable_hides_struct_type_vertex - local_struct_variable_hides_struct_type_fragment Signed-off-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Timothy Arceri <timothy.arceri@collabora.com>
* glsl: parse align layout qualifierTimothy Arceri2016-03-051-0/+11
| | | | | Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> Reviewed-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com>
* glsl: enable offset layout qualifier for ARB_enhanced_layoutsTimothy Arceri2016-03-051-1/+2
| | | | Reviewed-by: Edward O'Callaghan <eocallaghan@alterapraxis.com>
* glsl: rework parsing of blocksTimothy Arceri2016-03-051-29/+22
| | | | | | | | | | | Previously interface blocks were giving the global default flags of uniform blocks. This meant we could not check for invalid qualifiers on interface blocks because they always contained invalid flags. This changes parsing so that interface blocks now get an empty set of layouts. Reviewed-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com>
* glsl: move to compiler/Emil Velikov2016-01-261-0/+2855
Signed-off-by: Emil Velikov <emil.velikov@collabora.com> Acked-by: Matt Turner <mattst88@gmail.com> Acked-by: Jose Fonseca <jfonseca@vmware.com>