[Mesa-dev] [PATCH 02/12] nir: Fix fddy swizzles in nir_lower_wpos_ytransform().

Rob Clark robdclark at gmail.com
Thu May 19 16:54:27 UTC 2016


On Wed, May 18, 2016 at 6:00 PM, Kenneth Graunke <kenneth at whitecape.org> wrote:
> 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 at whitecape.org>

Reviewed-by: Rob Clark <robdclark at gmail.com>

> ---
>  src/compiler/nir/nir_lower_wpos_ytransform.c | 3 +++
>  1 file changed, 3 insertions(+)
>
> diff --git a/src/compiler/nir/nir_lower_wpos_ytransform.c b/src/compiler/nir/nir_lower_wpos_ytransform.c
> index 5546788..41f8554 100644
> --- a/src/compiler/nir/nir_lower_wpos_ytransform.c
> +++ b/src/compiler/nir/nir_lower_wpos_ytransform.c
> @@ -252,6 +252,9 @@ lower_fddy(lower_wpos_ytransform_state *state, nir_alu_instr *fddy)
>     nir_instr_rewrite_src(&fddy->instr,
>                           &fddy->src[0].src,
>                           nir_src_for_ssa(pt));
> +
> +   for (unsigned i = 0; i < 4; i++)
> +      fddy->src[0].swizzle[i] = MIN2(i, pt->num_components - 1);
>  }
>
>  static bool
> --
> 2.8.2
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev


More information about the mesa-dev mailing list