diff options
author | Brian Paul <brian.paul@tungstengraphics.com> | 2006-07-03 23:08:33 +0000 |
---|---|---|
committer | Brian Paul <brian.paul@tungstengraphics.com> | 2006-07-03 23:08:33 +0000 |
commit | 77afb435191cdaa0446aa65871c8ef995500bbcc (patch) | |
tree | 5c22f95cdb05a3fde7b51d4e030e59dfec1dfec0 | |
parent | 46c1419c9342f68755636208307ee6bbd5c0cc24 (diff) | |
download | external_mesa3d-77afb435191cdaa0446aa65871c8ef995500bbcc.zip external_mesa3d-77afb435191cdaa0446aa65871c8ef995500bbcc.tar.gz external_mesa3d-77afb435191cdaa0446aa65871c8ef995500bbcc.tar.bz2 |
additional clipping/viewport fixes (Martijn van Oosterhout)
-rw-r--r-- | src/mesa/drivers/dri/r128/r128_state.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/mesa/drivers/dri/r128/r128_state.c b/src/mesa/drivers/dri/r128/r128_state.c index 05ab389..491f288 100644 --- a/src/mesa/drivers/dri/r128/r128_state.c +++ b/src/mesa/drivers/dri/r128/r128_state.c @@ -608,6 +608,14 @@ static void r128UpdateClipping( GLcontext *ctx ) y1 = 0; else if ( y1 >= rmesa->driScreen->fbHeight ) y1 = rmesa->driScreen->fbHeight - 1; + if ( x2 < 0 ) + x2 = 0; + else if ( x2 >= rmesa->driScreen->fbWidth ) + x2 = rmesa->driScreen->fbWidth - 1; + if ( y2 < 0 ) + y2 = 0; + else if ( y2 >= rmesa->driScreen->fbHeight ) + y2 = rmesa->driScreen->fbHeight - 1; rmesa->setup.sc_top_left_c = (((y1 & 0x3FFF) << 16) | (x1 & 0x3FFF)); rmesa->setup.sc_bottom_right_c = (((y2 & 0x3FFF) << 16) | (x2 & 0x3FFF)); @@ -1226,7 +1234,10 @@ void r128DDUpdateHWState( GLcontext *ctx ) r128UpdateMasks( ctx ); if ( new_state & R128_NEW_WINDOW ) + { r128UpdateWindow( ctx ); + r128CalcViewport( ctx ); + } if ( rmesa->NewGLState & _NEW_TEXTURE ) { r128UpdateTextureState( ctx ); |