r300: Call radeonSetCliprects from radeonMakeCurrent.
authorMichel Dänzer <michel@tungstengraphics.com>
Tue, 6 Mar 2007 12:22:35 +0000 (13:22 +0100)
committerMichel Dänzer <michel@tungstengraphics.com>
Tue, 6 Mar 2007 12:22:35 +0000 (13:22 +0100)
Based on a patch by Panagiotis Papadakos.

Among other things, this makes sure the framebuffer object associated with the
drawable has the correct size when _mesa_make_current is called, so the default
viewport is set up correctly.

Also update radeon->lastStamp in radeonSetCliprects.

src/mesa/drivers/dri/r300/radeon_context.c
src/mesa/drivers/dri/r300/radeon_lock.c
src/mesa/drivers/dri/r300/radeon_state.c

index 3a6bde8fc31c48aff5ce9951d1665ff4ff9d393c..d66f1dc49e88d1a4816773b75575d2b1c03f1c4b 100644 (file)
@@ -51,6 +51,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #include "radeon_macros.h"
 #include "radeon_reg.h"
 
+#include "radeon_state.h"
 #include "r300_state.h"
 
 #include "utils.h"
@@ -279,6 +280,8 @@ GLboolean radeonMakeCurrent(__DRIcontextPrivate * driContextPriv,
 
                        r300UpdateWindow(radeon->glCtx);
                        r300UpdateViewportOffset(radeon->glCtx);
+
+                       radeonSetCliprects(radeon);
                }
 
                _mesa_make_current(radeon->glCtx,
index a00da6c8bc371efb4ffcef3daec30adc84f21f2b..1a2dfca7b0daa0f7ac0d6872bd4a69844d5e4230 100644 (file)
@@ -90,7 +90,6 @@ static void r300RegainedLock(radeonContextPtr radeon)
 #else
                radeonUpdateScissor(radeon->glCtx);
 #endif
-               radeon->lastStamp = drawable->lastStamp;
        }
 
        if (sarea->ctx_owner != radeon->dri.hwContext) {
index ddadf83a0032ae01589c6323d770b904c18c8342..902e9583a6336b6528f5d198118e4de1a05a1bbd 100644 (file)
@@ -185,6 +185,8 @@ void radeonSetCliprects(radeonContextPtr radeon)
 
        if (radeon->state.scissor.enabled)
                radeonRecalcScissorRects(radeon);
+
+       radeon->lastStamp = drawable->lastStamp;
 }