[Mesa-dev] [PATCH 3/3] glsl: Reassociate multiplication of mat*mat*vec.

Matt Turner mattst88 at gmail.com
Mon Mar 30 11:54:11 PDT 2015


On Sat, Mar 28, 2015 at 11:03 AM, Jason Ekstrand <jason at jlekstrand.net> wrote:
> On Fri, Mar 27, 2015 at 9:22 PM, Matt Turner <mattst88 at gmail.com> wrote:
>> The typical case of mat4*mat4*vec4 is 80 scalar multiplications, but
>> mat4*(mat4*vec4) is only 32.
>>
>> On HSW (with vec4 vertex shaders):
>> instructions in affected programs:     4420 -> 3194 (-27.74%)
>>
>> On BDW (with scalar vertex shaders):
>> instructions in affected programs:     12756 -> 6726 (-47.27%)
>
> Do you have any actual benchmark results with something that's
> affected?  That would be nice to know.

OglDrvShComp: 2.17761% +/- 0.324342% (n=12)

It draws a bunch of different scenes (from other benchmarks), so I
tried some of the other benchmarks, but couldn't find anything
interesting. I'm guessing the patch is just improving compile
performance which affects this benchmark.

IIRC this is the one that Ken's loop unrolling patch really harmed
performance of, so yeah, it's probably because of compile performance.
Not interesting.


More information about the mesa-dev mailing list