struct radeon_state_atom *atom;
int dwords;
- cp_wait(r300, R300_WAIT_3D | R300_WAIT_3D_CLEAN);
+ cp_wait(r300, R300_WAIT_3D | R300_WAIT_3D_CLEAN);
BEGIN_BATCH_NO_AUTOSTATE(2);
OUT_BATCH(cmdpacket0(r300->radeon.radeonScreen, R300_TX_INVALTAGS, 1));
OUT_BATCH(R300_TX_FLUSH);
END_BATCH();
- end_3d(r300);
+ end_3d(r300);
/* Emit actual atoms */
foreach(atom, &r300->hw.atomlist) {
foreach(atom, &r300->hw.atomlist) {
FREE(atom->cmd);
}
- rcommonDestroyCmdBuf(&r300->radeon);
}
_swrast_DestroyContext(r300->radeon.glCtx);
rcommonFlushCmdBuf(&r300->radeon, __FUNCTION__);
- r300DestroyCmdBuf(r300);
if (radeon->state.scissor.pClipRects) {
FREE(radeon->state.scissor.pClipRects);
radeon->state.scissor.pClipRects = NULL;
}
+ r300DestroyCmdBuf(r300);
+
radeonCleanupContext(&r300->radeon);
+
/* the memory manager might be accessed when Mesa frees the shared
* state, so don't destroy it earlier
*/
FILE *track;
struct radeon_renderbuffer *rb;
GLframebuffer *fb;
+
+ /* free the Mesa context */
+ _mesa_destroy_context(radeon->glCtx);
fb = (void*)radeon->dri.drawable->driverPrivate;
rb = (void *)fb->Attachment[BUFFER_FRONT_LEFT].Renderbuffer;
* radeon->glCtx->DriverCtx = NULL;
*/
- /* free the Mesa context */
- _mesa_destroy_context(radeon->glCtx);
+
/* free the option cache */
driDestroyOptionCache(&radeon->optionCache);
+ rcommonDestroyCmdBuf(radeon);
+
if (radeon->state.scissor.pClipRects) {
FREE(radeon->state.scissor.pClipRects);
radeon->state.scissor.pClipRects = 0;