diff options
author | Jeremy Kolb <[email protected]> | 2006-04-14 22:50:14 +0000 |
---|---|---|
committer | Jeremy Kolb <[email protected]> | 2006-04-14 22:50:14 +0000 |
commit | 576b3433dacd1f36fe5bb33dcf6c1dbadfe152c9 (patch) | |
tree | dbf5db6ee516a84d3edaa92030e7840a00b6b908 /src/mesa/drivers | |
parent | 4b2d8b46c8c68b0d10d9d3fa4a3820fa44ef4738 (diff) |
Cleaning
Diffstat (limited to 'src/mesa/drivers')
-rw-r--r-- | src/mesa/drivers/dri/nouveau/nouveau_context.h | 7 | ||||
-rw-r--r-- | src/mesa/drivers/dri/nouveau/nouveau_state.c | 13 |
2 files changed, 15 insertions, 5 deletions
diff --git a/src/mesa/drivers/dri/nouveau/nouveau_context.h b/src/mesa/drivers/dri/nouveau/nouveau_context.h index dcb14420330..442681cb7e8 100644 --- a/src/mesa/drivers/dri/nouveau/nouveau_context.h +++ b/src/mesa/drivers/dri/nouveau/nouveau_context.h @@ -54,6 +54,10 @@ nouveau_fifo; #include "tnl_dd/t_dd_vertex.h" #undef TAG +/* Subpixel offsets for window coordinates (triangles): */ +#define SUBPIXEL_X (0.0F) +#define SUBPIXEL_Y (0.125F) + struct nouveau_context; typedef void (*nouveau_tri_func)( struct nouveau_context*, @@ -121,7 +125,8 @@ typedef struct nouveau_context { uint32_t vblank_flags; - GLfloat viewport[16]; + GLmatrix viewport; + GLfloat depth_scale; }nouveauContextRec, *nouveauContextPtr; diff --git a/src/mesa/drivers/dri/nouveau/nouveau_state.c b/src/mesa/drivers/dri/nouveau/nouveau_state.c index c88b33b8847..5d12d1ca9f2 100644 --- a/src/mesa/drivers/dri/nouveau/nouveau_state.c +++ b/src/mesa/drivers/dri/nouveau/nouveau_state.c @@ -40,10 +40,9 @@ static void nouveauCalcViewport(GLcontext *ctx) { /* Calculate the Viewport Matrix */ -/* Taken from the intel driver nouveauContextPtr nmesa = NOUVEAU_CONTEXT(ctx); const GLfloat *v = ctx->Viewport._WindowMap.m; - GLfloat *m = nmesa->ViewportMatrix.m; + GLfloat *m = nmesa->viewport.m; GLint h = 0; if (nmesa->driDrawable) @@ -55,7 +54,7 @@ static void nouveauCalcViewport(GLcontext *ctx) m[MAT_TY] = - v[MAT_TY] + h; m[MAT_SZ] = v[MAT_SZ] * nmesa->depth_scale; m[MAT_TZ] = v[MAT_TZ] * nmesa->depth_scale; -*/ + } static nouveauViewport(GLcontext *ctx, GLint x, GLint y, GLsizei w, GLsizei h) @@ -75,7 +74,13 @@ static nouveauViewport(GLcontext *ctx, GLint x, GLint y, GLsizei w, GLsizei h) * 44c 0x03000000 <-- (Height_from_glViewport << 16) | (win_height - height - y) * */ + + nouveauCalcViewport(ctx); +} +void nouveauDepthRange(GLcontext *ctx) +{ + nouveauCalcViewport(ctx); } /* Initialize the context's hardware state. */ @@ -120,7 +125,7 @@ void nouveauDDInitStateFuncs(GLcontext *ctx) ctx->Driver.StencilMaskSeparate = NULL; //nouveauDDStencilMaskSeparate; ctx->Driver.StencilOpSeparate = NULL; //nouveauDDStencilOpSeparate; - ctx->Driver.DepthRange = NULL; //nouveauDepthRange; + ctx->Driver.DepthRange = nouveauDepthRange; ctx->Driver.Viewport = nouveauViewport; /* Pixel path fallbacks. |