nouveau: nv10: remove setting projection matrix when scaling viewport
authorPatrice Mandin <pmandin@caramail.com>
Fri, 31 Aug 2007 17:45:14 +0000 (19:45 +0200)
committerPatrice Mandin <pmandin@caramail.com>
Fri, 31 Aug 2007 17:46:39 +0000 (19:46 +0200)
src/mesa/drivers/dri/nouveau/nv10_state.c

index 9c63bd118a42dce0c497a952627a60e864a09f31..bdfc75b8750c2a96cf76e8ef36c5ae412019e3ce 100644 (file)
@@ -43,20 +43,17 @@ static void nv10ViewportScale(nouveauContextPtr nmesa)
        GLfloat projection[16];
        int i;
 
-       if (!ctx->DrawBuffer) {
-               return;
-       }
-       if (!ctx->DrawBuffer->_DepthBuffer) {
-               return;
-       }
-
-       switch (ctx->DrawBuffer->_DepthBuffer->DepthBits) {
-               case 16:
-                       max_depth *= 32767.0;
-                       break;
-               case 24:
-                       max_depth *= 16777215.0;
-                       break;
+       if (ctx->DrawBuffer) {
+               if (ctx->DrawBuffer->_DepthBuffer) {
+                       switch (ctx->DrawBuffer->_DepthBuffer->DepthBits) {
+                               case 16:
+                                       max_depth *= 32767.0;
+                                       break;
+                               case 24:
+                                       max_depth *= 16777215.0;
+                                       break;
+                       }
+               }
        }
 
        BEGIN_RING_SIZE(NvSub3D, NV10_TCL_PRIMITIVE_3D_VIEWPORT_SCALE_X, 4);
@@ -64,17 +61,6 @@ static void nv10ViewportScale(nouveauContextPtr nmesa)
        OUT_RINGf (h - 2048.0);
        OUT_RINGf (max_depth);
        OUT_RINGf (0.0);
-
-       /* FIXME: should multiply by gl projection and modelview ? */
-       memset(projection, 0, sizeof(projection));
-       projection[0*4+0] = w;
-       projection[1*4+1] = -h;
-       projection[2*4+2] = max_depth;
-       projection[3*4+3] = 1.0;
-       BEGIN_RING_SIZE(NvSub3D, NV10_TCL_PRIMITIVE_3D_PROJECTION_MATRIX(0), 16);
-       for (i=0; i<16; i++) {
-               OUT_RINGf (projection[i]);
-       }
 }
 
 static void nv10AlphaFunc(GLcontext *ctx, GLenum func, GLfloat ref)
@@ -786,11 +772,6 @@ static void nv10UpdateModelProjMatrix(nouveauContextPtr nmesa)
                projection[i+12] = nmesa->model_proj.m[i+12];
        }
 
-       for (i=0; i<16; i++) {
-               printf("%d\t%.3f\t%.3f\n", i,
-                       nmesa->model_proj.m[i], projection[i]);
-       }
-
        BEGIN_RING_SIZE(NvSub3D, NV10_TCL_PRIMITIVE_3D_PROJECTION_MATRIX(0), 16);
        OUT_RINGp(projection, 16);
 }