r300: Simplify r300VAPInputRoute1.
authorMarkus Amsler <markus.amsler@oribi.org>
Mon, 17 Mar 2008 11:03:54 +0000 (12:03 +0100)
committerJerome Glisse <glisse@freedesktop.org>
Mon, 17 Mar 2008 11:03:54 +0000 (12:03 +0100)
src/mesa/drivers/dri/r300/r300_emit.c

index 8e1d801a8d1e90af3e46d31bb08ae3f9fc2b4fe9..deb62b27621856973a9757063040033efe634c15 100644 (file)
@@ -238,14 +238,10 @@ static GLuint r300VAPInputRoute1Swizzle(int swizzle[4])
 GLuint r300VAPInputRoute1(uint32_t * dst, int swizzle[][4], GLuint nr)
 {
        GLuint i;
+       uint16_t * dst16 = (uint16_t *) dst;
 
-       for (i = 0; i + 1 < nr; i += 2) {
-               dst[i >> 1] = r300VAPInputRoute1Swizzle(swizzle[i]) | R300_INPUT_ROUTE_ENABLE;
-               dst[i >> 1] |= (r300VAPInputRoute1Swizzle(swizzle[i + 1]) | R300_INPUT_ROUTE_ENABLE) << 16;
-       }
-
-       if (nr & 1) {
-               dst[nr >> 1] = r300VAPInputRoute1Swizzle(swizzle[nr - 1]) | R300_INPUT_ROUTE_ENABLE;
+       for (i = 0; i < nr; i++) {
+               dst16[i] = r300VAPInputRoute1Swizzle(swizzle[i]) | R300_INPUT_ROUTE_ENABLE;
        }
 
        return (nr + 1) >> 1;