[Mesa-dev] ir_builder take 2

Kenneth Graunke kenneth at whitecape.org
Mon Apr 9 23:42:03 PDT 2012


On 04/09/2012 02:22 PM, Eric Anholt wrote:
> Here's the udpated ir_builder changeset.  Now at +140 lines, I think
> I'll still land it given that idr has said he's interested in it for
> the ARB programs to GLSL conversion work.  It now uses C++ tricks
> (noted in a big comment) to get compile-time type checking and
> ir_dereference_variable generation.  Oh, and it actually passes
> piglit.

Eric,

This series is fantastic!  The code is so much more readable.  You can 
actually just read through it and understand what's going on now, 
without getting lost in derefs, deref copies, and bizarre 2, 2, 2, 3, 3 
swizzle representations.

This has my wholehearted approval.  For the series:
Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>

As a follow-on clean-up, it'd be really sweet to see:

operand(float x)
{
    return new(...) ir_constant(x);
}

because then you could just do: mul(temp, 0.5).  So simple and clean! :)
Of course, that assumes you have a mem_ctx to put where I wrote "...", 
and...well...you don't.

It makes me wonder if we want to rework this to thread a memory context 
through somehow, rather than using ralloc_parent.  Classes, explicit 
argument, or #define hackery, I guess.  Who knows if it's worth it.

I'd love to play around with this more sometime, at any rate.


More information about the mesa-dev mailing list