summaryrefslogtreecommitdiffstats
path: root/src/compiler/nir/nir_lower_wpos_ytransform.c
Commit message (Collapse)AuthorAgeFilesLines
* nir: Flip gl_SamplePosition in nir_lower_wpos_ytransform().Francisco Jerez2016-11-091-0/+24
| | | | | | | | | | | | | | | | | | | Assuming the hardware is set up to use a screen coordinate system flipped vertically with respect to the GL's window coordinate system, the SYSTEM_VALUE_SAMPLE_POS vector will also be flipped vertically with respect to the value expected by the GL, so we need to give it the same treatment as gl_FragCoord. Fixes the following CTS tests on i965: ES31-CTS.functional.shaders.multisample_interpolation.interpolate_at_offset.at_sample_position.default_framebuffer ES31-CTS.functional.shaders.sample_variables.sample_pos.correctness.default_framebuffer when run with any multisample configuration, e.g. rgba8888d24s8ms4. Cc: <mesa-stable@lists.freedesktop.org> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com> (cherry picked from commit f3d387867f74ae758b41168f23992671f7dce254)
* 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>
* nir: Don't use ffma in nir_lower_wpos_ytransform().Kenneth Graunke2016-05-201-12/+8
| | | | | | | | | | | ffma is an explicitly fused multiply add with higher precision. The optimizer will take care of promoting mul/add to fma when it's beneficial to do so. This fixes failures on Gen4-5 when using this pass, as those platforms don't actually implement fma(). Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
* nir: Handle fddy_fine and fddy_coarse in nir_lower_wpos_ytransform.Kenneth Graunke2016-05-201-1/+3
| | | | | | | These also need flipping! Signed-off-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Rob Clark <robdclark@gmail.com>
* nir: Make lower_wpos_ytransform_block a void function.Kenneth Graunke2016-05-201-3/+1
| | | | | | | | The return value was used for the old nir_foreach_block callback system, but at this point it no longer means anything. Signed-off-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Rob Clark <robdclark@gmail.com>
* nir: Make nir_lower_wpos_ytransform() match FragCoord by location.Kenneth Graunke2016-05-201-1/+2
| | | | | | | | | | | | | gl_FragCoord is a shader input with location == VARYING_SLOT_POS. ARB_fragment_programs have an equivalent input at VARYING_SLOT_POS, but it isn't called gl_FragCoord. We do want to transform it. Matching by location guarantees we catch both. Fixes several fp tests on a branch which uses this pass on i965. Signed-off-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Rob Clark <robdclark@gmail.com>
* nir: Add interp_var_at_offset flipping.Kenneth Graunke2016-05-201-0/+21
| | | | | | | The Y-offset needs flipping as well, similar to ddy. Signed-off-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Rob Clark <robdclark@gmail.com>
* nir: Fix fddy swizzles in nir_lower_wpos_ytransform().Kenneth Graunke2016-05-201-0/+3
| | | | | | | | | | | The original value might have been swizzled. That's taken care of in the fmul source - we don't want to reswizzle it again. Fixes validation failures in glsl-derivs-varyings on a branch of mine which uses this pass in i965. Signed-off-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Rob Clark <robdclark@gmail.com>
* nir: Fix wpos_ytransform lowering state_slot swizzle.Kenneth Graunke2016-05-201-0/+2
| | | | | Signed-off-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Rob Clark <robdclark@gmail.com>
* nir: add lowering pass for y-transformRob Clark2016-05-111-0/+310
Signed-off-by: Rob Clark <robclark@freedesktop.org> Reviewed-by: Connor Abbott <cwabbott0@gmail.com> Reviewed-by: Eric Anholt <eric@anholt.net>