[Mesa-dev] [PATCH] i965: Use NIR by default for vertex shaders on GEN8+

Ian Romanick idr at freedesktop.org
Thu May 7 18:10:46 PDT 2015


On 05/07/2015 05:44 PM, Jason Ekstrand wrote:
> 
> On May 7, 2015 5:38 PM, "Ian Romanick" <idr at freedesktop.org
> <mailto:idr at freedesktop.org>> wrote:
>>
>> On 05/07/2015 04:50 PM, Jason Ekstrand wrote:
>> > GLSL IR vs. NIR shader-db results for SIMD8 vertex shaders on Broadwell:
>> >
>> >    total instructions in shared programs: 2724483 -> 2711790 (-0.47%)
>> >    instructions in affected programs:     1860859 -> 1848166 (-0.68%)
>> >    helped:                                4387
>> >    HURT:                                  4758
>> >    GAINED:                                1499
>> >
>> > The gained programs are ARB vertext programs that were previously going
>> > through the vec4 backend.  Now that we have prog_to_nir, ARB vertex
>> > programs can go through the scalar backend so they show up as
> "gained" in
>> > the shader-db results.
>>
>> I thought we already did this... why didn't this happen when NIR became
>> the default for the FS backend?  And has that reason (assuming there was
>> one) been resolved?
> 
> We couldn't do copy propagation of values in the attribute register
> file.  That, it turn was blocked on reworking the LOAD_PAYLOAD
> instruction.  I pushed a series this morning that fixed both of those
> and cut 7.5% off of all SIMD8 VS instructions when using NIR.  It also
> helps GLSL IR but by only 1% or so.
> --Jason

Ah, that's right.  Make it so!

Reviewed-by: Ian Romanick <ian.d.romanick at intel.com>

>> > ---
>> >  src/mesa/drivers/dri/i965/brw_context.c | 2 +-
>> >  1 file changed, 1 insertion(+), 1 deletion(-)
>> >
>> > diff --git a/src/mesa/drivers/dri/i965/brw_context.c
> b/src/mesa/drivers/dri/i965/brw_context.c
>> > index fd7420a..8615e5e 100644
>> > --- a/src/mesa/drivers/dri/i965/brw_context.c
>> > +++ b/src/mesa/drivers/dri/i965/brw_context.c
>> > @@ -588,7 +588,7 @@ brw_initialize_context_constants(struct
> brw_context *brw)
>> >       
> ctx->Const.ShaderCompilerOptions[MESA_SHADER_VERTEX].EmitNoIndirectTemp
> = true;
>> >       
> ctx->Const.ShaderCompilerOptions[MESA_SHADER_VERTEX].OptimizeForAOS = false;
>> >
>> > -      if (brw_env_var_as_boolean("INTEL_USE_NIR", false))
>> > +      if (brw_env_var_as_boolean("INTEL_USE_NIR", true))
>> >         
>  ctx->Const.ShaderCompilerOptions[MESA_SHADER_VERTEX].NirOptions =
> &nir_options;
>> >     }
>> >
>>



More information about the mesa-dev mailing list