fix projective texturing for (swtcl) texture rectangles. Fix wrong argument order...
authorRoland Scheidegger <rscheidegger@gmx.ch>
Mon, 26 Sep 2005 17:11:16 +0000 (17:11 +0000)
committerRoland Scheidegger <rscheidegger@gmx.ch>
Mon, 26 Sep 2005 17:11:16 +0000 (17:11 +0000)
src/mesa/drivers/dri/radeon/radeon_state.c
src/mesa/drivers/dri/radeon/radeon_swtcl.c

index c9ad1c84b0a9b453f11e927445acf19eb8d94ccf..3c7767768b2c5a96541f2e8e551c2fb7e1b148d2 100644 (file)
@@ -2073,11 +2073,11 @@ static void update_texturematrix( GLcontext *ctx )
            /* Need to preconcatenate any active texgen 
             * obj/eyeplane matrices:
             */
-           _math_matrix_mul_matrix( &rmesa->tmpmat, 
-                                    &rmesa->TexGenMatrix[unit],
-                                    ctx->TextureMatrixStack[unit].Top );
+           _math_matrix_mul_matrix( &rmesa->tmpmat,
+                                    ctx->TextureMatrixStack[unit].Top,
+                                    &rmesa->TexGenMatrix[unit] );
            upload_matrix( rmesa, rmesa->tmpmat.m, TEXMAT_0+unit );
-        } 
+        }
         else {
            rmesa->TexMatEnabled |= 
               (RADEON_TEXGEN_INPUT_TEXCOORD_0+unit) << inputshift;
index 410ec102f479751cce48b58fbe910c22f9387f31..90456191878ab47635c9ec0b8edb84cce1024146 100644 (file)
@@ -499,10 +499,20 @@ static GLboolean run_texrect_stage( GLcontext *ctx,
         GLint instride = VB->TexCoordPtr[i]->stride;
         GLfloat (*out)[4] = store->texcoord[i].data;
         GLint j;
-        
+
+        store->texcoord[i].size = VB->TexCoordPtr[i]->size;
         for (j = 0 ; j < VB->Count ; j++) {
-           out[j][0] = in[0] * iw;
-           out[j][1] = in[1] * ih;
+           switch (VB->TexCoordPtr[i]->size) {
+           case 4:
+              out[j][3] = in[3];
+           /* fallthrough */
+           case 3:
+              out[j][2] = in[2];
+           /* fallthrough */
+           default:
+              out[j][0] = in[0] * iw;
+              out[j][1] = in[1] * ih;
+           }
            in = (GLfloat *)((GLubyte *)in + instride);
         }