[Mesa-dev] [PATCH] nir: Lower interp_var_at_* like a normal load_var for flat inputs.
Jason Ekstrand
jason at jlekstrand.net
Fri Jul 22 18:30:36 UTC 2016
Seems reasonable. Rb
On Jul 22, 2016 11:04 AM, "Kenneth Graunke" <kenneth at whitecape.org> wrote:
> "flat centroid" and "flat sample" both just mean "flat", so we should
> ignore interpolateAtCentroid/Sample and just return the flat value.
>
> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=97032
> Signed-off-by: Kenneth Graunke <kenneth at whitecape.org>
> ---
> src/compiler/nir/nir_lower_io.c | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/src/compiler/nir/nir_lower_io.c
> b/src/compiler/nir/nir_lower_io.c
> index bf8296f..b36836f 100644
> --- a/src/compiler/nir/nir_lower_io.c
> +++ b/src/compiler/nir/nir_lower_io.c
> @@ -340,6 +340,10 @@ lower_interpolate_at(nir_intrinsic_instr *intrin,
> struct lower_io_state *state,
>
> assert(var->data.mode == nir_var_shader_in);
>
> + /* Ignore interpolateAt() for flat variables - flat is flat. */
> + if (var->data.interpolation == INTERP_MODE_FLAT)
> + return lower_load(intrin, state, NULL, offset);
> +
> nir_intrinsic_op bary_op;
> switch (intrin->intrinsic) {
> case nir_intrinsic_interp_var_at_centroid:
> --
> 2.9.0
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20160722/bcd69ee6/attachment-0001.html>
More information about the mesa-dev
mailing list