diff options
author | Eric Anholt <[email protected]> | 2007-12-17 14:28:54 -0800 |
---|---|---|
committer | Eric Anholt <[email protected]> | 2007-12-17 14:28:54 -0800 |
commit | 2c9e515d8607fb91f08c500a841cdf7f32bda346 (patch) | |
tree | 3a1319c1b2cfbd35511df1811c4bf74eb45687e3 /src/mesa/drivers/dri/i965/brw_sf_state.c | |
parent | 98d43552408045e34ba937913cfbad7aadee8213 (diff) |
[965] Replace our own depth constants in intel context with GL context ones.
Diffstat (limited to 'src/mesa/drivers/dri/i965/brw_sf_state.c')
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_sf_state.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_sf_state.c b/src/mesa/drivers/dri/i965/brw_sf_state.c index 5a0106f77ec..8891693e870 100644 --- a/src/mesa/drivers/dri/i965/brw_sf_state.c +++ b/src/mesa/drivers/dri/i965/brw_sf_state.c @@ -38,6 +38,8 @@ static void upload_sf_vp(struct brw_context *brw) { + GLcontext *ctx = &brw->intel.ctx; + const GLfloat depth_scale = 1.0F / ctx->DrawBuffer->_DepthMaxF; struct brw_sf_viewport sfv; memset(&sfv, 0, sizeof(sfv)); @@ -47,14 +49,14 @@ static void upload_sf_vp(struct brw_context *brw) /* _NEW_VIEWPORT, BRW_NEW_METAOPS */ if (!brw->metaops.active) { - const GLfloat *v = brw->intel.ctx.Viewport._WindowMap.m; + const GLfloat *v = ctx->Viewport._WindowMap.m; sfv.viewport.m00 = v[MAT_SX]; sfv.viewport.m11 = - v[MAT_SY]; - sfv.viewport.m22 = v[MAT_SZ] * brw->intel.depth_scale; + sfv.viewport.m22 = v[MAT_SZ] * depth_scale; sfv.viewport.m30 = v[MAT_TX]; sfv.viewport.m31 = - v[MAT_TY] + brw->intel.driDrawable->h; - sfv.viewport.m32 = v[MAT_TZ] * brw->intel.depth_scale; + sfv.viewport.m32 = v[MAT_TZ] * depth_scale; } else { sfv.viewport.m00 = 1; |