Fix r6 code bugs.
[mesa.git] / src / mesa / drivers / dri / radeon / radeon_common_context.c
index f8a29fdba083d93b94db67b9e463dd9ab8ceb5cc..30c858fce0f497b943d1e7c0630c1727868c04d7 100644 (file)
@@ -216,6 +216,11 @@ void radeonDestroyContext(__DRIcontextPrivate *driContextPriv )
        radeonContextPtr radeon = (radeonContextPtr) driContextPriv->driverPrivate;
        radeonContextPtr current = ctx ? RADEON_CONTEXT(ctx) : NULL;
 
+    /* +r6/r7 */
+    __DRIscreenPrivate *sPriv = driContextPriv->driScreenPriv;
+       radeonScreenPtr screen = (radeonScreenPtr) (sPriv->private);
+    /* --------- */
+
        if (radeon == current) {
                radeon_firevertices(radeon);
                _mesa_make_current(NULL, NULL, NULL);
@@ -224,6 +229,13 @@ void radeonDestroyContext(__DRIcontextPrivate *driContextPriv )
        assert(radeon);
        if (radeon) {
 
+#if RADEON_COMMON && defined(RADEON_COMMON_FOR_R600) /* +r6/r7 */
+           if (IS_R600_CLASS(screen))
+        {
+                   r600DestroyContext(driContextPriv);
+        }
+#endif
+
                if (radeon->dma.current) {
                        rcommonFlushCmdBuf( radeon, __FUNCTION__ );
                }