summaryrefslogtreecommitdiffstats
path: root/src/compiler/glsl/ast_to_hir.cpp
Commit message (Collapse)AuthorAgeFilesLines
* glsl: Size TCS->TES unsized arrays to gl_MaxPatchVertices for queries.Kenneth Graunke2016-10-271-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | SSO validation and other program interface queries want to see that unsized (non-patch) TCS output/TES input arrays are implicitly sized to gl_MaxPatchVertices. By the time we create the program resource lists, we've sized the arrays to their actual size. (We try to create TCS output arrays to match the output patch size right away, and at this point, we should have shrunk TES input arrays.) One option would be to keep them sized to gl_MaxPatchVertices, and defer shrinking them. But that's a big change, and I don't think it's a good idea. Instead, this patch introduces a new ir_variable flag which indicates the variable is implicitly to gl_MaxPatchVertices. Then, the linker munges the types when creating the resource list, ignoring the size in the IR's types. Basically, lie about it for resource queries. It's ugly, but I think it ought to work. We probably could use var->data.implicit_sized_array for this, but I opted for a separate bit to try and avoid convoluting the existing SSBO handling. They're similar in concept, but share none of the same code... Fixes: ES31-CTS.core.tessellation_shader.single.xfb_captures_data_from_correct_stage and the ES32-CTS and ESEXT-CTS variants. v2: Add a comment (requested by Timothy, written by me). Cc: mesa-stable@lists.freedesktop.org Signed-off-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Timothy Arceri <timothy.arceri@collabora.com> Reviewed-by: Tapani Pälli <tapani.palli@intel.com> (cherry picked from commit 173558445dce26ce641faf260a17696221acf23d)
* glsl: Drop the ES requirement that VS outputs must be flat qualified.Kenneth Graunke2016-10-151-8/+4
| | | | | | | | | | | | | | | | | | | Several conformance tests violate this requirement: ES31-CTS.core.tessellation_shader.max_patch_vertices ES31-CTS.core.tessellation_shader.tessellation_control_to_tessellation_evaluation.data_pass_through I submitted a merge request to fix the conformance tests, but Khronos opted to drop this GLSL ES specific requirement in favor of making flat qualification of VS outputs optional, matching modern desktop GL. Note that there were 7 Piglit tests which enforce this rule: tests/spec/glsl-es-3.00/compiler/interpolation/qualifiers/*nonflat* but these were deleted in Piglit commit acc0a2fabbd714bc704c16f1675e7c0. Bugzilla: https://cvs.khronos.org/bugzilla/show_bug.cgi?id=15465#c7 Signed-off-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Timothy Arceri <timothy.arceri@collabora.com>
* glsl: prohibit lowp, mediump precision on atomic_uintTapani Pälli2016-10-101-0/+14
| | | | | | | | | | | | Fixes following dEQP tests: dEQP-GLES31.functional.debug.negative_coverage.callbacks.atomic_counter.atomic_precision dEQP-GLES31.functional.debug.negative_coverage.get_error.atomic_counter.atomic_precision dEQP-GLES31.functional.debug.negative_coverage.log.atomic_counter.atomic_precision Signed-off-by: Tapani Pälli <tapani.palli@intel.com> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=98131 Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
* glsl: reject compute shaders with fixed and variable local sizeSamuel Pitoiset2016-10-071-0/+14
| | | | | | | | | | | The ARB_compute_variable_group_size specification explains that when a compute shader includes both a fixed and a variable local size, a compile-time error occurs. v2: - update formatting spec quotations (Ian) Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
* glsl: remove remaining tabs from ast_to_hir.cppTimothy Arceri2016-09-291-40/+38
| | | | Acked-by: Dave Airlie <airlied@redhat.com>
* glsl: Skip "unsized arrays aren't allowed" check for TCS/TES/GS vars.Kenneth Graunke2016-09-191-1/+27
| | | | | | | | Fixes ESEXT-CTS.draw_elements_base_vertex_tests.AEP_shader_stages and ESEXT-CTS.texture_cube_map_array.texture_size_tesselation_con_sh. Signed-off-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
* glsl: Convert ast_to_hir to the util hash tableThomas Helland2016-09-121-11/+13
| | | | | | | | | | V2: Rebase to the adaption of new hashing functions V3: move previous_label declaration to where it is used (Timothy Arceri) Signed-off-by: Thomas Helland <thomashelland90@gmail.com> Reviewed-by: Timothy Arceri <timothy.arceri@collabora.com>
* glsl: Fix locations of variables in patch qualified interface blocks.Kenneth Graunke2016-09-051-2/+4
| | | | | | | | | | | | | | | | | | | | | | | As of commit d82f8d9772813949d0f5455cd0edad9003be0fb0, we actually parse and attempt to handle the 'patch' qualifier on interface blocks. This patch fixes explicit locations for variables in such blocks. Without it, many program interface query dEQP/CTS tests hit this assertion in ir_set_program_inouts.cpp if (is_patch_generic) { assert(idx >= VARYING_SLOT_PATCH0 && idx < VARYING_SLOT_TESS_MAX); bitfield = BITFIELD64_BIT(idx - VARYING_SLOT_PATCH0); } because the location was incorrectly based on VARYING_SLOT_VAR0. Note that most of the tests affected currently fail before they hit this, due to confusion about what the program interface query name of those resources should be. Signed-off-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
* glsl: Reject TCS/TES input arrays not sized to gl_MaxPatchVertices.Kenneth Graunke2016-09-011-1/+14
| | | | | | | | | | | | | | | | | | We handled the unsized case, implicitly sizing arrays to the value of gl_MaxPatchVertices. But if a size was present, we failed to raise a compile error if it wasn't the value of gl_MaxPatchVertices. Fixes CTS tests: *.tessellation_shader.compilation_and_linking_errors. {tc,te}_invalid_array_size_used_for_input_blocks Piglit's tcs-input-read-nonconst-* tests have recently been fixed. This patch will break older copies of those tests, but the latest should continue working. Update to Piglit 75819c13af2ed5. Signed-off-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Francisco Jerez <currojerez@riseup.net>
* glsl: Handle patch qualifier on interface blocks.Kenneth Graunke2016-08-301-0/+4
| | | | | Signed-off-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
* glsl/ast: Allow redeclaration of gl_LastFragData with different precision ↵Francisco Jerez2016-08-241-0/+12
| | | | | | | | qualifier. v2: No need to check the GLSL version. (Ken) Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
* glsl: Handle the inout qualifier in fragment shader output declarations.Francisco Jerez2016-08-241-1/+4
| | | | | | | | | | | | 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: fix key used for hashing switch statement casesTapani Pälli2016-08-221-4/+24
| | | | | | | | | | | | Implementation previously used value itself as the key, however after hash implementation change by ee02a5e we cannot use 0 as key. v2: use constant pointer as the key and implement comparison for contents (Eric Anholt) Signed-off-by: Tapani Pälli <tapani.palli@intel.com> Reviewed-by: Eric Anholt <eric@anholt.net> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=97309
* glsl: emit a specific error when ast_*_assign changes typeIlia Mirkin2016-08-121-1/+27
| | | | | | | | | | | | | | | For regular ast_add, we can implicitly change either a or b's type. However in an assignment situation, the type of the lvalue is fixed. So if the implicit conversion logic decides to change it, it means that the rhs's type could not be converted to the lhs type. Emit a specific error for this rather than the rather mysterious "is not an lvalue" error that results from having a i2f or other operation as the lvalue. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=96729 Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu> Reviewed-by: Timothy Arceri <timothy.arceri@collabora.com>
* glsl: apply_implicit_conversion is static againAndres Gomez2016-08-051-1/+1
| | | | | Reviewed-by: Timothy Arceri <timothy.arceri@collabora.com> Signed-off-by: Andres Gomez <agomez@igalia.com>
* ast: Updated AST_NUM_OPERATORS for coherence with ast_operatorsAndres Gomez2016-08-021-0/+1
| | | | | | | | | | | | | | | AST_NUM_OPERATORS stores the dimension of the ast_operators enumeration but was not updated after its last modification. This doesn't add any real modification for any code paths but it makes sense for coherence. v2 (Eric Engestrom): Just place the define at the end of the enumeration, not below. Signed-off-by: Andres Gomez <agomez@igalia.com> Reviewed-by: Matt Turner <mattst88@gmail.com> Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
* glsl: be more strict on block qualifiersTimothy Arceri2016-07-311-11/+73
| | | | | | | V2: Add spec references and allow patch qualifier (Ken) Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=96528
* glsl: add name param to validate_flags()Timothy Arceri2016-07-311-4/+3
| | | | Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
* glsl: Remove references to tail_pred.Matt Turner2016-07-261-9/+9
|
* glsl: Separate overlapping sentinel nodes in exec_list.Matt Turner2016-07-261-3/+3
| | | | | | | | | | | I do appreciate the cleverness, but unfortunately it prevents a lot more cleverness in the form of additional compiler optimizations brought on by -fstrict-aliasing. No difference in OglBatch7 (n=20). Co-authored-by: Davin McCall <davmac@davmac.org> Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
* glsl: subroutine types cannot be comparedAndres Gomez2016-07-221-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | subroutine variables are to be used just in the way functions are called. Although the spec doesn't say it explicitely, this means that these variables are not to be used in any other way than those left for function calls. Therefore, a comparison between 2 subroutine variables should also cause a compilation error. From The OpenGL® Shading Language 4.40, page 117: " To use subroutines, a subroutine type is declared, one or more functions are associated with that subroutine type, and a subroutine variable of that type is declared. The function currently assigned to the variable function is then called by using function calling syntax replacing a function name with the name of the subroutine variable. Subroutine variables are uniforms, and are assigned to specific functions only through commands (UniformSubroutinesuiv) in the OpenGL API." From The OpenGL® Shading Language 4.40, page 118: " Subroutine uniform variables are called the same way functions are called. When a subroutine variable (or an element of a subroutine variable array) is associated with a particular function, all function calls through that variable will call that particular function." Fixes GL44-CTS.shader_subroutine.subroutines_cannot_be_assigned_float_int_values_or_be_compared Signed-off-by: Andres Gomez <agomez@igalia.com> Reviewed-by: Iago Toral Quiroga <itoral@igalia.com> Reviewed-by: Dave Airlie <airlied@redhat.com> Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
* MESA_shader_integer_functions: Allow implicit int->uint conversionsIan Romanick2016-07-191-1/+2
| | | | | Signed-off-by: Ian Romanick <ian.d.romanick@intel.com> Reviewed-by: Matt Turner <mattst88@gmail.com>
* compiler: Rename INTERP_QUALIFIER_* to INTERP_MODE_*.Kenneth Graunke2016-07-171-12/+12
| | | | | | | | | | | | | | | | | Likewise, rename the enum type to glsl_interp_mode. Beyond the GLSL front-end, talking about "interpolation modes" seems more natural than "interpolation qualifiers" - in the IR, we're removed from how exactly the source language specifies how to interpolate an input. Also, SPIR-V calls these "decorations" rather than "qualifiers". Generated by: $ find . -regextype egrep -regex '.*\.(c|cpp|h)' -type f -exec sed -i \ -e 's/INTERP_QUALIFIER_/INTERP_MODE_/g' \ -e 's/glsl_interp_qualifier/glsl_interp_mode/g' {} \; Signed-off-by: Kenneth Graunke <kenneth@whitecape.org> Acked-by: Dave Airlie <airlied@redhat.com>
* glsl: add driconf to zero-init unintialized varsRob Clark2016-07-021-0/+8
| | | | | | | | | | | | | Some games are sloppy.. perhaps because it is defined behavior for DX or perhaps because nv blob driver defaults things to zero. So add driconf param to force uninitialized variables to default to zero. This issue was observed with rust, from steam store. But has surfaced elsewhere in the past. Signed-off-by: Rob Clark <robclark@freedesktop.org> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
* Remove wrongly repeated words in commentsGiuseppe Bilotta2016-06-231-1/+1
| | | | | | | | | | | | | | | | | Clean up misrepetitions ('if if', 'the the' etc) found throughout the comments. This has been done manually, after grepping case-insensitively for duplicate if, is, the, then, do, for, an, plus a few other typos corrected in fly-by v2: * proper commit message and non-joke title; * replace two 'as is' followed by 'is' to 'as-is'. v3: * 'a integer' => 'an integer' and similar (originally spotted by Jason Ekstrand, I fixed a few other similar ones while at it) Signed-off-by: Giuseppe Bilotta <giuseppe.bilotta@gmail.com> Reviewed-by: Chad Versace <chad.versace@intel.com>
* glsl: Always strip arrayness in precision_qualifier_allowedIan Romanick2016-06-161-11/+6
| | | | | | | | | | | | | | | | Previously some callers of precision_qualifier_allowed would strip the arrayness from the type and some would not. As a result, some places would not notice that float[6], for example, needed a precision qualifier. Fixes the new piglit test no-default-float-array-precision.frag. Signed-off-by: Ian Romanick <ian.d.romanick@intel.com> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=96358 Cc: "12.0" <mesa-stable@lists.freedesktop.org> Cc: Gregory Hainaut <gregory.hainaut@gmail.com> Cc: Ilia Mirkin <imirkin@alum.mit.edu> Reviewed-by: Timothy Arceri <timothy.arceri@collabora.com>
* glsl: make sure UBO arrays are sized in ESTimothy Arceri2016-06-141-0/+14
| | | | | | | | This check was removed in 5b2675093e86 add it back in. Reviewed-by: Dave Airlie <airlied@redhat.com> Cc: "12.0" <mesa-stable@lists.freedesktop.org> https://bugs.freedesktop.org/show_bug.cgi?id=96349
* glsl: use new interfaces for 64-bit checks.Dave Airlie2016-06-091-2/+2
| | | | | | | | This is just prep work for int64 support, changing places where 64-bit matters no doubles. Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu> Signed-off-by: Dave Airlie <airlied@redhat.com>
* glsl: handle ast_aggregate in has_sequence_subexpression. (v2)Dave Airlie2016-06-061-1/+1
| | | | | | | | | | | | | | | GL43-CTS.compute_shader.work-group-size does uniform uint g_uniform[gl_WorkGroupSize.z + 20] = { 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24 }; The initializer triggers the GLSL 4.30/GLES3 tests for constant sequence subexpressions, so it doesn't happen unless you are using those, so just return false as this path is now reachable. v2: update commit msg with diagnosis Acked-by: Timothy Arceri <timothy.arceri@collabora.com> Cc: "11.2 12.0" <mesa-stable@lists.freedesktop.org> Signed-off-by: Dave Airlie <airlied@redhat.com>
* Revert "glsl: fix xfb_offset unsized array validation"Timothy Arceri2016-06-011-15/+8
| | | | | | | | | | | This reverts commit aac90ba2920cf5ceb4df6dba776dd3952780e456. The commit caused a regression in: piglit.spec.glsl-1_50.compiler.gs-input-nonarray-named-block.geom Also the CTS test it was meant to fix seems like it may be bogus. Cc: "12.0" <mesa-stable@lists.freedesktop.org>
* glsl: fix xfb_offset unsized array validationTimothy Arceri2016-05-301-8/+15
| | | | | | | | | | | | | | | | This partially fixes CTS test: GL44-CTS.enhanced_layouts.xfb_get_program_resource_api The test now fails at a tes evaluation shader with unsized output arrays. The ARB_enhanced_layouts spec says: "It is a compile-time error to apply xfb_offset to the declaration of an unsized array." So this seems like a bug in the CTS. Reviewed-by: Dave Airlie <airlied@redhat.com>
* glsl: dont crash when attempting to assign a value to a builtin defineTimothy Arceri2016-05-301-1/+1
| | | | | | | | | For example GL_ARB_enhanced_layouts = 3; Fixes: GL44-CTS.enhanced_layouts.glsl_contant_immutablity Reviewed-by: Dave Airlie <airlied@redhat.com>
* glsl/ast: subroutineTypes can't be returned from functions.Dave Airlie2016-05-301-0/+9
| | | | | | | | | | | These types can't be returned. This fixes: GL43-CTS.shader_subroutine.subroutines_not_allowed_as_variables_constructors_and_argument_or_return_types for the return type case. Reviewed-by: Chris Forbes <chrisforbes@google.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
* glsl: use has_double() helperTimothy Arceri2016-05-301-2/+1
| | | | Reviewed-by: Eduardo Lima Mitev <elima@igalia.com>
* glsl: fix explicit uniform block alignmentTimothy Arceri2016-05-301-3/+1
| | | | | | | | | | | | This stops the offset being bumped again when and an explicit alignment has already been applied. Fixes alignment issues in: GL44-CTS.enhanced_layouts.uniform_block_alignment Note the test still fails due to unrelated issues with doubles. Reviewed-by: Eduardo Lima Mitev <elima@igalia.com>
* glsl: add a empty set_is_lhs on ast_nodeAlejandro Piñeiro2016-05-261-0/+5
| | | | | | | | | Just to allow to call set_is_lhs on any ast_node without a casting. Useful when processing a ast_node list that we know it contain ast_expression. v2: comment out new_value to avoid unused parameter warning (Ian Romanick) Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
* glsl: handle implicit sized arrays in ssboDave Airlie2016-05-261-45/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The current code disallows unsized arrays except at the end of an SSBO but it is a bit overzealous in doing so. struct a { int b[]; int f[4]; }; is valid as long as b is implicitly sized within the shader, i.e. it is accessed only by integer indices. I've submitted some piglit tests to test for this. This also has no regressions on piglit on my Haswell. This fixes: GL45-CTS.shader_storage_buffer_object.basic-syntax GL45-CTS.shader_storage_buffer_object.basic-syntaxSSO This patch moves a chunk of the linker code down, so that we don't link the uniform blocks until after we've merged all the variables. The logic went something like: Removing the checks for last ssbo member unsized from the compiler and into the linker, meant doing the check in the link_uniform_blocks code. However to do that the array sizing had to happen first, so we knew that the only unsized arrays were in the last block. But array sizing required the variable to be merged, otherwise you'd get two different array sizes in different version of two variables, and one would get lost when merged. So the solution was to move array sizing up, after variable merging, but before uniform block visiting. Reviewed-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
* glsl/ast: assign explicit_xfb_buffer from correct placeDave Airlie2016-05-261-1/+1
| | | | | | | | | | | This fixes: GL44-CTS.tessellation_shader.tessellation_control_to_tessellation_evaluation.data_pass_through As the OUT_TC interface structures weren't matching because one of them had explicit_xfb_buffer set when it shouldn't. Reviewed-by: Timothy Arceri <timothy.arceri@collabora.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
* glsl: make max array trackers ints and use -1 as base. (v2)Dave Airlie2016-05-241-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This fixes a bug that breaks cull distances. The problem is the max array accessors can't tell the difference between an never accessed unsized array and an accessed at location 0 unsized array. This leads to converting an undeclared unused gl_ClipDistance inside or outside gl_PerVertex to a size 1 array. However we need to the number of active clip distances to work out the starting point for the cull distances, and this offset by one when it's not being used isn't possible to distinguish from the case were only the first element is accessed. I tried to use ->used for this, but that doesn't work when gl_ClipDistance is part of an interface block. So this changes things so that max_array_access is an int and initialised to -1. This also allows unsized arrays to proceed further than that could before, but we really shouldn't mind as they will get eliminated if nothing uses them later. For initialised uniforms we no longer change their array size at runtime, if these are unused they will get eliminated eventually. v2: use ralloc_array (Ilia) Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu> Signed-off-by: Dave Airlie <airlied@redhat.com>
* glsl: fix subroutine uniform .length().Dave Airlie2016-05-231-0/+8
| | | | | | | | | | | | | This fixes .length() on subroutine uniform arrays, if we don't find the identifier normally, we look up the corresponding subroutine identifier instead. Fixes: GL45-CTS.shader_subroutine.arrays_of_arrays_of_uniforms GL45-CTS.shader_subroutine.arrayed_subroutine_uniforms Reviewed-by: Chris Forbes <chrisforbes@google.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
* glsl: validate subroutine types match function signature.Dave Airlie2016-05-231-0/+18
| | | | | | | | | | | This fixes: GL43-CTS.shader_subroutine.subroutines_incompatible_with_subroutine_type It just makes sure the signatures match as well as the return types. Reviewed-by: Chris Forbes <chrisforbes@google.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
* glsl: Guard against NULL dereferenceMark Janes2016-05-201-1/+1
| | | | | | | | | This trivially corrects mesa 3ca1c221, which introduced a check that crashes when a match is not found. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=95005 Fixes: piglit.spec.glsl-1_50.compiler.interface-blocks-name-reused-globally-4.vert Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
* glsl: handle same struct redeclaration (v2)Dave Airlie2016-05-201-1/+6
| | | | | | | | | | | | | | | | This works around a bug in older version of UE4, where a shader defines the same structure twice. Although we aren't sure this is correct GLSL (it most likely isn't) there are enough UE4 based things out there we should deal with this. This drops the error to a warning if the struct names and contents match. v1.1: do better C++ on record_compare declaration (Rob) v2: restrict this to desktop GL only (Ian) Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=95005 Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
* glsl: Check that layout is non-null before dereferencing.Matt Turner2016-05-181-1/+1
| | | | | | | layout should only be null for structs, but it's checked everywhere else and confuses Coverity (CID 1358495). Reviewed-by: Timothy Arceri <timothy.arceri@collabora.com>
* glsl: Add arb_cull_distance support (v3)Tobias Klausmann2016-05-141-14/+32
| | | | | | | | | v2: make too large array a compile error v3: squash mesa/prog patch to avoid static compiler errors in bisect Signed-off-by: Tobias Klausmann <tobias.johannes.klausmann@mni.thm.de> Signed-off-by: Dave Airlie <airlied@redhat.com> Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
* glsl: Apply memory qualifiers to vars inside named block interfacesEduardo Lima Mitev2016-05-101-7/+15
| | | | | | This is missing and memory qualifiers are currently being ignored for SSBOs. Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
* glsl: validate and store component layout qualifier in GLSL IRTimothy Arceri2016-05-011-0/+38
| | | | | | | | | We make use of the existing IR field location_frac used for tracking component locations. Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com> Reviewed-by: Edward O'Callaghan <eocallaghan@alterapraxis.com> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
* glsl: Checks for interpolation into its own function.Andres Gomez2016-04-291-145/+171
| | | | | | | | | | | | This generalizes the validation also to be done for variables inside interface blocks, which, for some cases, was missing. For a discussion about the additional validation cases included see https://lists.freedesktop.org/archives/mesa-dev/2016-March/109117.html and Khronos bug #15671. Reviewed-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com> Signed-off-by: Andres Gomez <agomez@igalia.com>
* glsl: Reject illegal qualifiers on atomic counter uniforms.Kenneth Graunke2016-04-121-0/+11
| | | | | | | | | | | | | | | | | | | This fixes dEQP-GLES31.functional.uniform_location.negative.atomic_fragment dEQP-GLES31.functional.uniform_location.negative.atomic_vertex Both of which have lines like layout(location = 3, binding = 0, offset = 0) uniform atomic_uint uni0; The ARB_explicit_uniform_location spec makes a very tangential mention regarding atomic counters, but location isn't something that makes sense with them. Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu> Signed-off-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Timothy Arceri <timothy.arceri@collabora.com>
* glsl: allow conservative depth qualifiers in GLSL 420Ilia Mirkin2016-04-031-1/+3
| | | | | Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu> Reviewed-by: Dave Airlie <airlied@redhat.com>