[Mesa-dev] [PATCH 9/9] i965: Use NIR by default for Fragment shaders on SNB+

Jason Ekstrand jason at jlekstrand.net
Tue Mar 17 20:53:42 PDT 2015


I did this for SNB+ only because we did have some shader-db
regressions.  However, with the patch 8.5 I just sent out, we're down
to about +0.2% on ILK-.  Arguably, that's probably close enough for
the old platforms especially if it lets us move forward.

The majority of hurt shaders there are planeshift shaders which are
hurt because they use indirect uniforms which causes NIR to do pull
constants for everything and that's bad.  We need to get our uniform
story figured out better for NIR soon.

Also, I didn't recommend it for SIMD8 FS on BDW because the shader-db
result there are not great.  I don't know that I'd say dire, but it
needs some work/looking into.
--Jason

On Tue, Mar 17, 2015 at 7:17 PM, Jason Ekstrand <jason at jlekstrand.net> wrote:
> GLSL IR vs. NIR FS instructions on snb:
> total instructions in shared programs: 4976784 -> 4973072 (-0.07%)
> instructions in affected programs:     3309521 -> 3305809 (-0.11%)
> helped:                                7161
> HURT:                                  9839
> GAINED:                                55
> LOST:                                  23
>
> GLSL IR vs. NIR FS instructions on ivb:
> total instructions in shared programs: 4593938 -> 4588496 (-0.12%)
> instructions in affected programs:     2948822 -> 2943380 (-0.18%)
> helped:                                6878
> HURT:                                  8801
> GAINED:                                69
> LOST:                                  44
>
> GLSL IR vs. NIR FS instructions on hsw:
> total instructions in shared programs: 4089459 -> 4081368 (-0.20%)
> instructions in affected programs:     2592474 -> 2584383 (-0.31%)
> helped:                                6492
> HURT:                                  9403
> GAINED:                                69
> LOST:                                  32
>
> GLSL IR vs. NIR FS instructions on bdw:
> total instructions in shared programs: 4065050 -> 4058653 (-0.16%)
> instructions in affected programs:     2555555 -> 2549158 (-0.25%)
> helped:                                5910
> HURT:                                  9765
> GAINED:                                45
> LOST:                                  53
> ---
>  src/mesa/drivers/dri/i965/brw_fs.cpp | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/src/mesa/drivers/dri/i965/brw_fs.cpp b/src/mesa/drivers/dri/i965/brw_fs.cpp
> index 3d4d31a..42f6604 100644
> --- a/src/mesa/drivers/dri/i965/brw_fs.cpp
> +++ b/src/mesa/drivers/dri/i965/brw_fs.cpp
> @@ -3943,7 +3943,7 @@ fs_visitor::run_fs()
>         * functions called "main").
>         */
>        if (shader) {
> -         if (env_var_as_boolean("INTEL_USE_NIR", false)) {
> +         if (env_var_as_boolean("INTEL_USE_NIR", brw->gen >= 6)) {
>              emit_nir_code();
>           } else {
>              foreach_in_list(ir_instruction, ir, shader->base.ir) {
> --
> 2.3.2
>


More information about the mesa-dev mailing list