Fixes for bugs that were nailed down when compairing against software vertex shading.
[mesa.git] / src / mesa / drivers / dri / r300 / radeon_context.c
index d04045d9717effdafea10f9442903f4eac4053a4..b2cb9cfb5f459b15f4574320469647479c00f4e7 100644 (file)
@@ -206,6 +206,23 @@ GLboolean radeonInitContext(radeonContextPtr radeon,
 }
 
 
+/**
+ * Cleanup common context fields.
+ * Called by r200DestroyContext/r300DestroyContext
+ */
+void radeonCleanupContext(radeonContextPtr radeon)
+{
+       /* free the Mesa context */
+       radeon->glCtx->DriverCtx = NULL;
+       _mesa_destroy_context(radeon->glCtx);
+
+       if (radeon->state.scissor.pClipRects) {
+               FREE(radeon->state.scissor.pClipRects);
+               radeon->state.scissor.pClipRects = 0;
+       }
+}
+
+
 /**
  * Swap front and back buffer.
  */