summaryrefslogtreecommitdiffstats
path: root/src/compiler
Commit message (Collapse)AuthorAgeFilesLines
* nir: Remove spurious return from void function.Jose Fonseca2016-05-061-2/+0
| | | | | | | | Left over from 450c0613627d5a472fcf1122c15b66988abfb372. Trivial. Built locally with clang and gcc. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=95296
* nir: remove now-unused nir_foreach_block*_call()Connor Abbott2016-05-051-38/+0
| | | | | | Reviewed-by: Jason Ekstrand <[email protected]> Reviewed-by: Connor Abbott <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* nir/lower_double_ops: fixup for new nir_foreach_block()Jason Ekstrand2016-05-051-23/+9
| | | | | | Signed-off-by: Jason Ekstrand <[email protected]> Reviewed-by: Connor Abbott <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* nir/lower_double_pack: fixup for new nir_foreach_block()Jason Ekstrand2016-05-051-26/+21
| | | | | | Signed-off-by: Jason Ekstrand <[email protected]> Reviewed-by: Connor Abbott <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* nir/gather_info: fixup for new foreach_block()Jason Ekstrand2016-05-051-5/+5
| | | | | | Signed-off-by: Jason Ekstrand <[email protected]> Reviewed-by: Connor Abbott <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* nir/lower_two_sided_color: fixup for new foreach_block()Connor Abbott2016-05-051-3/+5
| | | | | Reviewed-by: Jason Ekstrand <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* nir/lower_tex: fixup for new foreach_block()Connor Abbott2016-05-051-25/+22
| | | | | Reviewed-by: Jason Ekstrand <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* nir/lower_outputs_to_temporaries: fixup for new foreach_block()Connor Abbott2016-05-051-16/+12
| | | | | Reviewed-by: Jason Ekstrand <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* nir: Optimize out stores of undefs.Kenneth Graunke2016-05-051-0/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | There are a couple of cycle count changes in shader-db, but it's basically a wash. However, with the Broadwell scalar TCS backend enabled, many Shadow of Mordor shaders benefit from this patch. Because we don't batch up output writes for TCS, vec4 outputs might not have all components defined. Many output writes have a value of undef, which is useless. With scalar TCS, stats for tessellation shaders on Broadwell: total instructions in shared programs: 1283000 -> 1280444 (-0.20%) instructions in affected programs: 34302 -> 31746 (-7.45%) helped: 71 HURT: 0 total cycles in shared programs: 10798768 -> 10780682 (-0.17%) cycles in affected programs: 158004 -> 139918 (-11.45%) helped: 71 HURT: 0 Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Matt Turner <[email protected]>
* nir: Replace vecN(undef, undef, ...) with a single undef.Kenneth Graunke2016-05-051-0/+33
| | | | | | | | | | | | | | | | | | | | | | | shader-db statistics on Broadwell: total instructions in shared programs: 8963409 -> 8962455 (-0.01%) instructions in affected programs: 60858 -> 59904 (-1.57%) helped: 318 HURT: 0 total cycles in shared programs: 71408022 -> 71406276 (-0.00%) cycles in affected programs: 398416 -> 396670 (-0.44%) helped: 199 HURT: 51 GAINED: 1 The only shaders affected were in Dota 2 Reborn. It also sets up for the next optimization. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Matt Turner <[email protected]>
* nir: Rename opt_undef_alu to opt_undef_csel; update comments.Kenneth Graunke2016-05-051-12/+13
| | | | | | | | | | | | This better reflects what it does. I plan to add other ALU optimizations as well, so the old name would be confusing. In preparation for that, also move the file comments about csels above the opt_undef_csel function, and delete the ones about there not being other optimizations. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Matt Turner <[email protected]>
* nir: fix assert for wildcard pairsThomas Hindoe Paaboel Andersen2016-05-051-1/+1
| | | | | | | | | The assert was null checking dest_arr_parent twice. The intention seems to be to check both dest_ and src_. Added in d3636da9 Reviewed-by: Eduardo Lima Mitev <[email protected]>
* nir: Separate 32 and 64-bit fmod loweringSamuel Iglesias Gonsálvez2016-05-042-3/+5
| | | | | | | | Split 32-bit and 64-bit fmod lowering as the drivers might need to lower them separately inside NIR depending on the HW support. Signed-off-by: Samuel Iglesias Gonsálvez <[email protected]> Reviewed-by: Jordan Justen <[email protected]>
* nir/lower_double_ops: lower mod()Samuel Iglesias Gonsálvez2016-05-042-1/+31
| | | | | | | | | | | There are rounding errors with the division in i965 that affect the mod(x,y) result when x = N * y. Instead of returning '0' it was returning 'y'. This lowering pass fixes those cases. Signed-off-by: Samuel Iglesias Gonsálvez <[email protected]> Reviewed-by: Jordan Justen <[email protected]>
* glsl: subroutine types cannot be used in constructors.Dave Airlie2016-05-041-0/+6
| | | | | | | | This fixes two of the cases in GL43-CTS.shader_subroutine.subroutines_not_allowed_as_variables_constructors_and_argument_or_return_types Reviewed-by: Iago Toral Quiroga <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* glsl: resource is a reserved keyword in GLSL 4.20 as wellDave Airlie2016-05-041-1/+1
| | | | | | | | | resource just appears in GLSL 4.20 without any fanfare. Fixes GL43-CTX.CommonBugs.CommonBug_ReservedNames Reviewed-by: Iago Toral Quiroga <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* nir: make lower_clamp_color pass work after lower i/oRob Clark2016-05-021-4/+18
| | | | | | | Kinda important to work with tgsi_to_nir, which generates nir which already has i/o lowered. Signed-off-by: Rob Clark <[email protected]>
* mesa: add LOCATION_COMPONENT support to GetProgramResourceivTimothy Arceri2016-05-011-0/+1
| | | | | | | | | | | | From Section 7.3.1.1 (Naming Active Resources) of the OpenGL 4.5 spec: "For the property LOCATION_COMPONENT, a single integer indicating the first component of the location assigned to an active input or output variable is written to params. For input and output variables with a component specified by a layout qualifier, the specified component is written. For all other input and output variables, the value zero is written." Reviewed-by: Anuj Phogat <[email protected]>
* glsl: add component to has_layout() helperTimothy Arceri2016-05-011-0/+1
| | | | | | | | | I don't think this will do much as it's a compiler error to use component without location which is already in the table but its good to be consistent. Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Samuel Iglesias Gonsálvez <[email protected]>
* glsl: validate linking of intrastage component qualifiersTimothy Arceri2016-05-011-0/+7
| | | | | Reviewed-by: Anuj Phogat <[email protected]> Reviewed-by: Edward O'Callaghan <[email protected]>
* glsl: update explicit location matching to support component qualifierTimothy Arceri2016-05-011-4/+5
| | | | | | | | | This is needed so we don't optimise away the varying when more than one shares the same location. Reviewed-by: Anuj Phogat <[email protected]> Reviewed-by: Edward O'Callaghan <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* glsl: cross validate varyings with a component qualifierTimothy Arceri2016-05-011-11/+52
| | | | | | | | | | | | | | | | This change checks for component overlap, including handling overlap of locations and components by doubles. Previously there was no validation for assigning explicit locations to a location used by the second half of a double. V3: simplify handling of doubles and fix double component aliasing detection V2: fix component matching for matricies Reviewed-by: Anuj Phogat <[email protected]> Reviewed-by: Edward O'Callaghan <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* glsl: validate and store component layout qualifier in GLSL IRTimothy Arceri2016-05-012-0/+43
| | | | | | | | | We make use of the existing IR field location_frac used for tracking component locations. Reviewed-by: Anuj Phogat <[email protected]> Reviewed-by: Edward O'Callaghan <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* glsl: allow component qualifier on varying inputsTimothy Arceri2016-05-011-0/+1
| | | | Reviewed-by: Edward O'Callaghan <[email protected]>
* glsl: parse component layout qualifierTimothy Arceri2016-05-013-0/+28
| | | | | | Reviewed-by: Anuj Phogat <[email protected]> Reviewed-by: Edward O'Callaghan <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* spirv: automake: add missing headers to the tarball.Emil Velikov2016-05-011-0/+2
| | | | Signed-off-by: Emil Velikov <[email protected]>
* nir/lower_double_ops: fix indentationThomas Hindoe Paaboel Andersen2016-04-301-30/+30
| | | | Reviewed-by: Jason Ekstrand <[email protected]>
* nir/opt_dead_cf: fix indentationThomas Hindoe Paaboel Andersen2016-04-301-4/+4
| | | | Reviewed-by: Jason Ekstrand <[email protected]>
* nir/opt_dead_cf: correction of side effect checkThomas Hindoe Paaboel Andersen2016-04-301-2/+2
| | | | | | | Parenthesis are needed here as ! takes precedence over the &. The check had the opposite effect than intended. Reviewed-by: Jason Ekstrand <[email protected]>
* nir: clamp-color-output supportRob Clark2016-04-303-0/+120
| | | | | | | Handled by tgsi_emulate for glsl->tgsi case. Signed-off-by: Rob Clark <[email protected]> Reviewed-by: Connor Abbott <[email protected]>
* glsl: Lower vector_extracts to swizzles after lower_vector_derefs.Kenneth Graunke2016-04-291-0/+1
| | | | | | | | | | | | | | | lower_vector_derefs can produce new vector_extract operations. Neither i965 nor st_glsl_to_tgsi can handle them, so we'd best convert them to swizzles. Together with the previous patch, this fixes assertion failures in GLideN64, as well as a new Piglit test which reproduces the issue: spec/glsl-1.10/compiler/vector-dereference-in-dereference.frag Cc: [email protected] Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=95164 Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* glsl: Convert lower_vec_index_to_swizzle to a rvalue visitor.Kenneth Graunke2016-04-291-83/+13
| | | | | | | | | | | | | | The old visitor missed some cases. For example, it wouldn't handle an ir_dereference_array with a vector_extract as the index. Rather than trying to add the missing cases, just rewrite it as an ir_rvalue_visitor. This makes it easy to replace any expression, and is much less code. Cc: [email protected] Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=95164 Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* 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 <[email protected]> Signed-off-by: Andres Gomez <[email protected]>
* nir/algebraic: Support lowering for both 64 and 32-bit ldexpJason Ekstrand2016-04-281-9/+22
| | | | Reviewed-by: Samuel Iglesias Gonsálvez <[email protected]>
* nir/opcodes: Make ldexp take an explicitly 32-bit intJason Ekstrand2016-04-282-2/+2
| | | | | | | | | There is no sense in having the double version of ldexp take a 64-bit integer. Instead, let's just take a 32-bit int all the time. This also matches what GLSL does where both variants of ldexp take a regular integer for the exponent argument. Reviewed-by: Samuel Iglesias Gonsálvez <[email protected]>
* nir/opcodes: Simplify the expressions for [un]pack_doubleJason Ekstrand2016-04-281-61/+8
| | | | | | | | | | The new expressions are more explicit in terms of where the bits go so it's a little easier to tell what's going on. This is the way GLSL specifies things so it's a bit easier to verify too. It also has the benifit that the new expressions easily vectorize so we can constant-fold vector forms of the _split versions correctly. Reviewed-by: Samuel Iglesias Gonsálvez <[email protected]>
* nir: Switch the arguments to nir_foreach_defJason Ekstrand2016-04-284-5/+5
| | | | | | | | | | This matches the "foreach x in container" pattern found in many other programming languages. Generated by the following regular expression: s/nir_foreach_def(\([^,]*\),\s*\([^,]*\))/nir_foreach_def(\2, \1)/ Reviewed-by: Eduardo Lima Mitev <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* nir: Switch the arguments to nir_foreach_use and friendsJason Ekstrand2016-04-2810-25/+25
| | | | | | | | | | | This matches the "foreach x in container" pattern found in many other programming languages. Generated by the following regular expression: s/nir_foreach_use(\([^,]*\),\s*\([^,]*\))/nir_foreach_use(\2, \1)/ and similar expressions for nir_foreach_use_safe, etc. Reviewed-by: Ian Romanick <[email protected]>
* nir: Switch the arguments to nir_foreach_functionJason Ekstrand2016-04-2846-53/+53
| | | | | | | | | This matches the "foreach x in container" pattern found in many other programming languages. Generated by the following regular expression: s/nir_foreach_function(\([^,]*\),\s*\([^,]*\))/nir_foreach_function(\2, \1)/ Reviewed-by: Ian Romanick <[email protected]>
* nir: Switch the arguments to nir_foreach_parallel_copy_entryJason Ekstrand2016-04-284-7/+7
| | | | | | | | This matches the "foreach x in container" pattern found in many other programming languages. Reviewed-by: Eduardo Lima Mitev <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* nir: Switch the arguments to nir_foreach_phi_srcJason Ekstrand2016-04-2814-22/+22
| | | | | | | | | | | This matches the "foreach x in container" pattern found in many other programming languages. Generated by the following regular expression: s/nir_foreach_phi_src(\([^,]*\),\s*\([^,]*\))/nir_foreach_phi_src(\2, \1)/ and a similar expression for nir_foreach_phi_src_safe. Reviewed-by: Eduardo Lima Mitev <[email protected]>
* nir: Switch the arguments to nir_foreach_instrJason Ekstrand2016-04-2850-82/+82
| | | | | | | | | | | This matches the "foreach x in container" pattern found in many other programming languages. Generated by the following regular expression: s/nir_foreach_instr(\([^,]*\),\s*\([^,]*\))/nir_foreach_instr(\2, \1)/ and similar expressions for nir_foreach_instr_safe etc. Reviewed-by: Ian Romanick <[email protected]>
* nir/algebraic: fixup for new foreach_block()Connor Abbott2016-04-281-20/+14
| | | | Reviewed-by: Jason Ekstrand <[email protected]>
* nir/validate: fixup for new foreach_block()Connor Abbott2016-04-281-10/+4
| | | | Reviewed-by: Jason Ekstrand <[email protected]>
* nir/nir_worklist: fixup for new foreach_block()Connor Abbott2016-04-281-9/+3
| | | | Reviewed-by: Jason Ekstrand <[email protected]>
* nir/remove_dead_variables: fixup for new foreach_block()Connor Abbott2016-04-281-28/+20
| | | | Reviewed-by: Jason Ekstrand <[email protected]>
* nir/split_var_copies: fixup for new foreach_block()Connor Abbott2016-04-281-4/+4
| | | | Reviewed-by: Jason Ekstrand <[email protected]>
* nir/repair_ssa: fixup for new foreach_block()Connor Abbott2016-04-281-11/+5
| | | | Reviewed-by: Jason Ekstrand <[email protected]>
* nir/opt_peephole_select: fixup for new foreach_block()Connor Abbott2016-04-281-23/+14
| | | | Reviewed-by: Jason Ekstrand <[email protected]>
* nir/phi_builder: fixup for new foreach_block()Connor Abbott2016-04-281-9/+3
| | | | Reviewed-by: Jason Ekstrand <[email protected]>