コード例 #1
0
void
intelDestroyContext(__DRIcontext * driContextPriv)
{
   struct brw_context *brw =
      (struct brw_context *) driContextPriv->driverPrivate;
   struct gl_context *ctx = &brw->ctx;

   assert(brw); /* should never be null */
   if (!brw)
      return;

   /* Dump a final BMP in case the application doesn't call SwapBuffers */
   if (INTEL_DEBUG & DEBUG_AUB) {
      intel_batchbuffer_flush(brw);
      aub_dump_bmp(&brw->ctx);
   }

   _mesa_meta_free(&brw->ctx);

   if (INTEL_DEBUG & DEBUG_SHADER_TIME) {
      /* Force a report. */
      brw->shader_time.report_time = 0;

      brw_collect_and_report_shader_time(brw);
      brw_destroy_shader_time(brw);
   }

   brw_destroy_state(brw);
   brw_draw_destroy(brw);

   drm_intel_bo_unreference(brw->curbe.curbe_bo);

   free(brw->curbe.last_buf);
   free(brw->curbe.next_buf);

   drm_intel_gem_context_destroy(brw->hw_ctx);

   if (ctx->swrast_context) {
      _swsetup_DestroyContext(&brw->ctx);
      _tnl_DestroyContext(&brw->ctx);
   }
   _vbo_DestroyContext(&brw->ctx);

   if (ctx->swrast_context)
      _swrast_DestroyContext(&brw->ctx);

   intel_batchbuffer_free(brw);

   drm_intel_bo_unreference(brw->first_post_swapbuffers_batch);
   brw->first_post_swapbuffers_batch = NULL;

   driDestroyOptionCache(&brw->optionCache);

   /* free the Mesa context */
   _mesa_free_context_data(&brw->ctx);

   ralloc_free(brw);
   driContextPriv->driverPrivate = NULL;
}
コード例 #2
0
ファイル: brw_context.c プロジェクト: CPFDSoftware-Tony/gmv
static void brw_destroy_context( struct pipe_context *pipe )
{
   struct brw_context *brw = brw_context(pipe);
   int i;

   brw_context_flush( brw );
   brw_batchbuffer_free( brw->batch );
   brw_destroy_state(brw);

   brw_draw_cleanup( brw );

   brw_pipe_blend_cleanup( brw );
   brw_pipe_depth_stencil_cleanup( brw );
   brw_pipe_framebuffer_cleanup( brw );
   brw_pipe_flush_cleanup( brw );
   brw_pipe_misc_cleanup( brw );
   brw_pipe_query_cleanup( brw );
   brw_pipe_rast_cleanup( brw );
   brw_pipe_sampler_cleanup( brw );
   brw_pipe_shader_cleanup( brw );
   brw_pipe_vertex_cleanup( brw );
   brw_pipe_clear_cleanup( brw );

   brw_hw_cc_cleanup( brw );


   FREE(brw->wm.compile_data);

   for (i = 0; i < brw->curr.fb.nr_cbufs; i++)
      pipe_surface_reference(&brw->curr.fb.cbufs[i], NULL);
   brw->curr.fb.nr_cbufs = 0;
   pipe_surface_reference(&brw->curr.fb.zsbuf, NULL);

   bo_reference(&brw->curbe.curbe_bo, NULL);
   bo_reference(&brw->vs.prog_bo, NULL);
   bo_reference(&brw->vs.state_bo, NULL);
   bo_reference(&brw->vs.bind_bo, NULL);
   bo_reference(&brw->gs.prog_bo, NULL);
   bo_reference(&brw->gs.state_bo, NULL);
   bo_reference(&brw->clip.prog_bo, NULL);
   bo_reference(&brw->clip.state_bo, NULL);
   bo_reference(&brw->clip.vp_bo, NULL);
   bo_reference(&brw->sf.prog_bo, NULL);
   bo_reference(&brw->sf.state_bo, NULL);
   bo_reference(&brw->sf.vp_bo, NULL);

   for (i = 0; i < Elements(brw->wm.sdc_bo); i++)
      bo_reference(&brw->wm.sdc_bo[i], NULL);

   bo_reference(&brw->wm.bind_bo, NULL);

   for (i = 0; i < Elements(brw->wm.surf_bo); i++)
      bo_reference(&brw->wm.surf_bo[i], NULL);

   bo_reference(&brw->wm.sampler_bo, NULL);
   bo_reference(&brw->wm.prog_bo, NULL);
   bo_reference(&brw->wm.state_bo, NULL);
}
コード例 #3
0
/* called from intelDestroyContext()
 */
static void brw_destroy_context( struct intel_context *intel )
{
   GLcontext *ctx = &intel->ctx;
   struct brw_context *brw = brw_context(&intel->ctx);

   brw_destroy_metaops(brw);
   brw_destroy_state(brw);
   brw_draw_destroy( brw );

   brw_ProgramCacheDestroy( ctx );
   brw_FrameBufferTexDestroy( brw );
}
コード例 #4
0
ファイル: brw_vtbl.c プロジェクト: UIKit0/mesa
/**
 * called from intelDestroyContext()
 */
static void brw_destroy_context( struct intel_context *intel )
{
   struct brw_context *brw = brw_context(&intel->ctx);

   brw_destroy_state(brw);
   brw_draw_destroy( brw );

   ralloc_free(brw->wm.compile_data);

   dri_bo_release(&brw->curbe.curbe_bo);
   dri_bo_release(&brw->vs.const_bo);
   dri_bo_release(&brw->wm.const_bo);

   free(brw->curbe.last_buf);
   free(brw->curbe.next_buf);

   drm_intel_gem_context_destroy(intel->hw_ctx);
}
コード例 #5
0
ファイル: brw_vtbl.c プロジェクト: VadimGirlin/mesa
/**
 * called from intelDestroyContext()
 */
static void brw_destroy_context( struct intel_context *intel )
{
   struct brw_context *brw = brw_context(&intel->ctx);

   if (INTEL_DEBUG & DEBUG_SHADER_TIME) {
      /* Force a report. */
      brw->shader_time.report_time = 0;

      brw_collect_and_report_shader_time(brw);
      brw_destroy_shader_time(brw);
   }

   brw_destroy_state(brw);
   brw_draw_destroy( brw );

   dri_bo_release(&brw->curbe.curbe_bo);
   dri_bo_release(&brw->vs.const_bo);
   dri_bo_release(&brw->wm.const_bo);

   free(brw->curbe.last_buf);
   free(brw->curbe.next_buf);

   drm_intel_gem_context_destroy(intel->hw_ctx);
}