> I've also been working on some fragment program stuff. I have attached what > I've done so far, which works quite well with Keith's texenv program > generation > that's in Mesa cvs. Not all arb_f_p opcodes are implemented, but I > think everything's > there that the texenv stuff needs. > > I was planning on commiting this soon, but you may have a better > approach than I > took so I'll wait a bit.
I have tried a similar approach at first but as swizzle appear it looks awful, i haven't take a deeper look at the way you handle it but you have a bunch of if test like i got in my first version. You certainly have done cleaner version than my first attempt thought. Anyway now what i have is the stupid way of having a table for all swizzle case, just for the x,y,z component as w is in sep an easier reg. Thus i got two tab one for xyz to FPI0_SRC conv which have a special value for not native format, this special value in an index in the second tab where i got all the code for all differents cases (64 cases less 7 of native format). This consumes few bytes about 1ko... Thus what we may do is use this table or use your swizzle function. Table lookup are faster but we doesn't have to translate code often, no ? Anyway other part of the code is basicly the same, yours is in a more advanced state than mine thus we should use yours... Anyone have strong feeling on this swizzle thing ? Or even an magic idea with a magic bitwise formula :) One other interesting feature is reuse of temp register at some point i was thinking of adding a free_temp function and having a stack of free register. Then get_temp first take from the stack if not empty, or use a new temp if empty. This get/free approach is usefull with swizzling where you know that you will use a temps register only for 1 instruction. But there may be case where you reuse the same swizzled src. I am wondering if you emit_const_swizzle may not consume all const if say you have an const which is used in all of the 64 possibles swizzle... I may have miss something on that thought. But if we know that we will only use the const in a swizzled format then your solution is the best. I got other idea on optimizing this swizzling in program translation (basicly tracking operand). But this are maybe useless optimization for time being... Jerome Glisse ------------------------------------------------------- This SF.Net email is sponsored by Oracle Space Sweepstakes Want to be the first software developer in space? Enter now for the Oracle Space Sweepstakes! http://ads.osdn.com/?ad_idt12&alloc_id344&op=click -- _______________________________________________ Dri-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/dri-devel
