[Mesa-dev] [PATCH 09/11] nir/lower_vec_to_movs: Get rid of start_idx and swizzle compacting

Jason Ekstrand jason at jlekstrand.net
Mon Sep 14 09:41:27 PDT 2015


On Fri, Sep 11, 2015 at 8:58 AM, Eric Anholt <eric at anholt.net> wrote:
> Jason Ekstrand <jason at jlekstrand.net> writes:
>
>> Previously, we did this thing with keeping track of a separate start_idx
>> which was different from the iteration variable.  I think this was a relic
>> of the way that GLSL IR implements writemasks.  In NIR, if a given bit in
>> the writemask is unset then that channel is just "unused", not missing.  In
>> particular, a vec4 operation with a writemask of 0xd will use sources 0, 2,
>> and 3 and leave source 1 alone.  We can simplify things a good deal (and
>> make them correct) by removing this "compacting" step.
>
> Reviewed-by: Eric Anholt <eric at anholt.net>
>
> Unrelated: looks like the instances of '4' should be
> 'nir_op_infos[vec->op].num_inputs' in the loops, though.

No, those are fine.  They're for components, not number of sources.


More information about the mesa-dev mailing list