On 2/10/07, Rune Petersen <[EMAIL PROTECTED]> wrote: > Hi, > > Getting proper SIN and COS wasn't as easy as it appeared. I had to make > make some changes to the fragment program code. > > general FP changes: > - support HHH swizzle for vector instructions. > - don't copy a source to a temp when it is not XYZW swizzled, but > combine the two and have the swizzle resolve any issues. > (saves temps/instructions with more elaborate shader code) > - Disable refcounting of temps. > The temp R0 in progs/fp/tri-cos.c is freed prematurely. > This should be resolved properly. > - fix overflow in cnstv[]. > > > SIN & COS: > they are based on: > http://www.devmaster.net/forums/showthread.php?t=5784 > > There is an fast and a slow(high precision) version of SIN & COS. > > For SIN: > fast = 2 vector instructions > slow = 5 vector instructions > > For COS: > fast = 5 vector instructions + 2 scaler instructions > slow = 8 vector instructions + 2 scaler instructions > > The fast version appears to do a fine enough job, at least with the > simple test I have made. > > > Rune Petersen
Nice to tackle this :) few comment, maybe we could make an driconf option to switch btw fast and slow version (or a more general conf option to enable or disable fragprog optimization in case we come with more optimization like that in the future). For the refcounting i am wondering if i didn't bump into that in the past, i did use gdb to trace fragprog construction at that time and found some strange interaction (which lead me to the rework i did on fragprog). Anyway here from limited testing your patch seems good, you should commit it. best, Jerome Glisse ------------------------------------------------------------------------- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier. Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 -- _______________________________________________ Dri-devel mailing list Dri-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/dri-devel