r300: handle texcoords properly
authorMaciej Cencora <m.cencora@gmail.com>
Thu, 23 Apr 2009 13:41:08 +0000 (15:41 +0200)
committerDave Airlie <airlied@linux.ie>
Mon, 27 Apr 2009 09:06:00 +0000 (19:06 +1000)
add 1D texture case and setup default Q value to 1.0

src/mesa/drivers/dri/r300/r300_swtcl.c

index 256a2bb5cb2ce242b43d9fbaf53d99150b554eb4..55187d4bc8058e45846b2f2c4c5db6e71ee0d2e6 100644 (file)
@@ -211,15 +211,19 @@ static void r300SetVertexFormat( GLcontext *ctx )
                        if (RENDERINPUTS_TEST(tnl->render_inputs_bitset, _TNL_ATTRIB_TEX(i) )) {
                                switch (VB->TexCoordPtr[i]->size) {
                                        case 1:
+                                               format = EMIT_1F;
+                                               swiz = MAKE_SWIZZLE4(SWIZZLE_X, SWIZZLE_ZERO, SWIZZLE_ZERO, SWIZZLE_ONE);
+                                               mask = MASK_X;
+                                               break;
                                        case 2:
                                                format = EMIT_2F;
-                                               swiz = MAKE_SWIZZLE4(SWIZZLE_X, SWIZZLE_Y, SWIZZLE_ZERO, SWIZZLE_ZERO);
+                                               swiz = MAKE_SWIZZLE4(SWIZZLE_X, SWIZZLE_Y, SWIZZLE_ZERO, SWIZZLE_ONE);
                                                mask = MASK_X | MASK_Y;
                                                size = 2;
                                                break;
                                        case 3:
                                                format = EMIT_3F;
-                                               swiz = MAKE_SWIZZLE4(SWIZZLE_X, SWIZZLE_Y, SWIZZLE_Z, SWIZZLE_ZERO);
+                                               swiz = MAKE_SWIZZLE4(SWIZZLE_X, SWIZZLE_Y, SWIZZLE_Z, SWIZZLE_ONE);
                                                mask = MASK_X | MASK_Y | MASK_Z;
                                                size = 3;
                                                break;