(i send a bigger message with more example but it did not reach the list)
Le lundi 24 Avril 2006 02:01, Hugh Fisher a écrit : > The argument for vectors is that, with todays GPUs, the > majority of the instructions are four-way vector ops to > begin with. Follow the extract of the code compile by Carl Witty. 1er shader : MOV result.color, c[8].x; 1 MOV result.texcoord[0].xy, vertex.texcoord[0]; 2 MUL result.texcoord[1].xy, vertex.texcoord[0], c[9].x; 2 MOV result.texcoord[4].w, c[10].x; 1 DP3 result.texcoord[4].z, vertex.normal, c[4]; 3 DP3 result.texcoord[4].y, vertex.attrib[15], c[4]; 3 DP3 result.texcoord[4].x, vertex.attrib[14], c[4]; 3 MOV result.texcoord[5].w, c[11].x; 1 DP3 result.texcoord[5].z, vertex.normal, c[5]; 3 DP3 result.texcoord[5].y, vertex.attrib[15], c[5]; 3 DP3 result.texcoord[5].x, vertex.attrib[14], c[5]; 3 DP3 result.texcoord[6].z, vertex.normal, c[6]; 3 DP3 result.texcoord[6].y, vertex.attrib[15], c[6]; 3 DP3 result.texcoord[6].x, vertex.attrib[14], c[6]; 3 MUL R1, vertex.position.y, c[5]; 1 MUL R0, vertex.position.y, c[1]; 1 MAD R0, vertex.position.x, c[0], R0; 1 MAD R1, vertex.position.x, c[4], R1; 1 MAD R1, vertex.position.z, c[6], R1; 1 MAD R0, vertex.position.z, c[2], R0; 1 MAD result.position, vertex.position.w, c[3], R0; 1 MAD result.texcoord[7], vertex.position.w, c[7], R1; 1 22 instructions : - no instruction with vect4 so 1 FPU always idle - 9 instructions with vect3 to a scalar - 2 vect2 instructions - 13 scalar instructions - estimated cycle for a vector shader : 22 - estimated cycle for a LIW scalar shader : 42 - speedup 4 scalar core / 1 vect4 core : x2.1
_______________________________________________ Open-graphics mailing list [email protected] http://lists.duskglow.com/mailman/listinfo/open-graphics List service provided by Duskglow Consulting, LLC (www.duskglow.com)
