From ece08b7fd9af5ba67afa0a5d8e0a11f688ab4b0f Mon Sep 17 00:00:00 2001 From: Patrice Mandin Date: Tue, 4 Sep 2007 19:13:07 +0200 Subject: nouveau: nv10: need to transpose mesa model+proj matrix for hw --- src/mesa/drivers/dri/nouveau/nouveau_context.c | 1 - src/mesa/drivers/dri/nouveau/nouveau_context.h | 3 --- src/mesa/drivers/dri/nouveau/nv10_state.c | 15 +++++---------- 3 files changed, 5 insertions(+), 14 deletions(-) (limited to 'src/mesa/drivers/dri/nouveau') diff --git a/src/mesa/drivers/dri/nouveau/nouveau_context.c b/src/mesa/drivers/dri/nouveau/nouveau_context.c index 0f7bd4aa07..1e13324b98 100644 --- a/src/mesa/drivers/dri/nouveau/nouveau_context.c +++ b/src/mesa/drivers/dri/nouveau/nouveau_context.c @@ -210,7 +210,6 @@ GLboolean nouveauCreateContext( const __GLcontextModes *glVisual, _swsetup_CreateContext( ctx ); _math_matrix_ctr(&nmesa->viewport); - _math_matrix_ctr(&nmesa->projection); nouveauDDInitStateFuncs( ctx ); nouveauSpanInitFunctions( ctx ); diff --git a/src/mesa/drivers/dri/nouveau/nouveau_context.h b/src/mesa/drivers/dri/nouveau/nouveau_context.h index 51666ef91c..77fe13a9cd 100644 --- a/src/mesa/drivers/dri/nouveau/nouveau_context.h +++ b/src/mesa/drivers/dri/nouveau/nouveau_context.h @@ -123,9 +123,6 @@ typedef struct nouveau_context { GLuint color_offset; GLuint specular_offset; - /* Projection matrix */ - GLmatrix projection; - /* Vertex state */ GLuint vertex_size; GLubyte *verts; diff --git a/src/mesa/drivers/dri/nouveau/nv10_state.c b/src/mesa/drivers/dri/nouveau/nv10_state.c index 93fc4ff936..94525ba2a8 100644 --- a/src/mesa/drivers/dri/nouveau/nv10_state.c +++ b/src/mesa/drivers/dri/nouveau/nv10_state.c @@ -40,7 +40,6 @@ static void nv10ViewportScale(nouveauContextPtr nmesa) GLfloat w = ((GLfloat) ctx->Viewport.Width) * 0.5; GLfloat h = ((GLfloat) ctx->Viewport.Height) * 0.5; GLfloat max_depth = (ctx->Viewport.Near + ctx->Viewport.Far) * 0.5; - int i; if (ctx->DrawBuffer) { if (ctx->DrawBuffer->_DepthBuffer) { @@ -757,22 +756,18 @@ static void nv10UpdateProjectionMatrix(GLcontext *ctx) } } - /* Calc projection * modelview */ - _math_matrix_mul_matrix(&(nmesa->projection), &(ctx->_ModelProjectMatrix), - ctx->ModelviewMatrixStack.Top); - - /* Rescale for viewport */ + /* Transpose and rescale for viewport */ for (i=0; i<4; i++) { - projection[i] = w * nmesa->projection.m[i]; + projection[i] = w * ctx->_ModelProjectMatrix.m[i*4]; } for (i=0; i<4; i++) { - projection[i+4] = -h * nmesa->projection.m[i+4]; + projection[i+4] = -h * ctx->_ModelProjectMatrix.m[i*4+1]; } for (i=0; i<4; i++) { - projection[i+8] = max_depth * nmesa->projection.m[i+8]; + projection[i+8] = max_depth * ctx->_ModelProjectMatrix.m[i*4+2]; } for (i=0; i<4; i++) { - projection[i+12] = nmesa->projection.m[i+12]; + projection[i+12] = ctx->_ModelProjectMatrix.m[i*4+3]; } BEGIN_RING_SIZE(NvSub3D, NV10_TCL_PRIMITIVE_3D_PROJECTION_MATRIX(0), 16); -- cgit v1.2.3