[Mesa-dev] [PATCH] i965/fs: Fix saturate on MAD and LRP with the NIR backend.

Jason Ekstrand jason at jlekstrand.net
Tue Feb 3 07:06:03 PST 2015


Ooh! I bet this fixes our rendering problems on some of those benchmarks
too!  I was wondering why generating made was causing problems.

Reviewed-by: Jason Ekstrand <jason.ekstrand at intel.com>
On Feb 3, 2015 1:18 AM, "Kenneth Graunke" <kenneth at whitecape.org> wrote:

> Fixes misrendering in "Witcher 2" with INTEL_USE_NIR=1, and probably
> many other programs.
>
> Signed-off-by: Kenneth Graunke <kenneth at whitecape.org>
> ---
>  src/mesa/drivers/dri/i965/brw_fs_nir.cpp | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
>
> This depends on Jason's 3 patch series that removes emit_percomp.
> It's available in the 'nir-madfix' branch of my tree.
>
> This was caught by tests/spec/arb_fragment_program/lrp_sat.shader_test
> with my in-progress Mesa IR -> NIR converter code, so I don't think we
> need to write more Piglit tests.  We just don't have a GLSL based one.
>
> diff --git a/src/mesa/drivers/dri/i965/brw_fs_nir.cpp
> b/src/mesa/drivers/dri/i965/brw_fs_nir.cpp
> index fbb1622..153a1be 100644
> --- a/src/mesa/drivers/dri/i965/brw_fs_nir.cpp
> +++ b/src/mesa/drivers/dri/i965/brw_fs_nir.cpp
> @@ -1070,12 +1070,14 @@ fs_visitor::nir_emit_alu(nir_alu_instr *instr)
>        break;
>
>     case nir_op_ffma:
> -      emit(MAD(result, op[2], op[1], op[0]));
> +      inst = emit(MAD(result, op[2], op[1], op[0]));
> +      inst->saturate = instr->dest.saturate;
>        break;
>
>     case nir_op_flrp:
>        /* TODO emulate for gen < 6 */
> -      emit(LRP(result, op[2], op[1], op[0]));
> +      inst = emit(LRP(result, op[2], op[1], op[0]));
> +      inst->saturate = instr->dest.saturate;
>        break;
>
>     case nir_op_bcsel:
> --
> 2.2.2
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20150203/d3ab5161/attachment-0001.html>


More information about the mesa-dev mailing list