summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPatrice Mandin <pmandin@caramail.com>2007-08-31 19:45:14 +0200
committerPatrice Mandin <pmandin@caramail.com>2007-08-31 19:46:39 +0200
commit47768ce0e59a76cbe367fe3b66be4150cd4ea3a8 (patch)
treecfc1252dff84ab3d6f5b50c4d50fbd45eeba549e /src
parentb0a1e81887a831f72ffbec4fe005e1837c81018c (diff)
nouveau: nv10: remove setting projection matrix when scaling viewport
Diffstat (limited to 'src')
-rw-r--r--src/mesa/drivers/dri/nouveau/nv10_state.c41
1 files changed, 11 insertions, 30 deletions
diff --git a/src/mesa/drivers/dri/nouveau/nv10_state.c b/src/mesa/drivers/dri/nouveau/nv10_state.c
index 9c63bd118a..bdfc75b875 100644
--- a/src/mesa/drivers/dri/nouveau/nv10_state.c
+++ b/src/mesa/drivers/dri/nouveau/nv10_state.c
@@ -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);
}