[Mesa-dev] [PATCH 1/9] glsl: Consolidate ir_expression constructors that use explicit types.

Kenneth Graunke kenneth at whitecape.org
Tue Feb 26 09:59:49 PST 2013


On 02/19/2013 05:03 PM, Matt Turner wrote:
> From: Kenneth Graunke <kenneth at whitecape.org>
>
> Previously, we had separate constructors for one, two, and four operand
> expressions.  This patch consolidates them into a single constructor
> which uses NULL default parameters.
>
> The unary and binary operator constructors had assertions to verify that
> the caller supplied the correct number of operands for the expression,
> but the four-operand version did not.  Since get_num_operands for
> ir_quadop_vector returns the number of vector_elements, we can safely
> add that without breaking the semantics of ir_quadop_vector.
>
> This also paves the way for expressions with three operands.  Currently,
> none can be constructed since get_num_operands() never returns 3.
>
> Reviewed-by: Matt Turner <mattst88 at gmail.com>

For patches 1-3, and 5-6:
Signed-off-by: Kenneth Graunke <kenneth at whitecape.org>

For patches 4 and 7-9:
Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>

(except for the missing gen check, which was my fault originally)

It was also rather amusing to re-read my patches, as I apparently wrote 
a lot more code than I have any recollection of writing :)

Thanks for doing this, Matt!


More information about the mesa-dev mailing list