[Mesa-dev] [PATCH 14/21] glsl: Add a new ir_builder::dotlike() function.

Kenneth Graunke kenneth at whitecape.org
Wed Sep 4 20:12:11 PDT 2013


On 09/04/2013 07:11 PM, Matt Turner wrote:
> On Wed, Sep 4, 2013 at 3:22 PM, Kenneth Graunke <kenneth at whitecape.org> wrote:
>> dotlike() uses ir_binop_mul for scalars, and ir_binop_dot for vectors.
>>
>> When generating built-in functions, we often want to use regular
>> multiply for scalar signatures, and dot() for vector signatures.
>> ir_binop_dot only works on vectors, so we have to switch opcodes,
>> even if the code is otherwise identical.  dotlike() makes this easy.
>
> Why not just make dot() do this?

I wasn't sure how I felt about dot() returning something other than 
ir_binop_dot.  But it kind of makes sense, so if people would prefer 
that, I'm fine with doing that instead.

--Ken


More information about the mesa-dev mailing list