Esempio n. 1
0
void draw_destroy( struct draw_context *draw )
{
   struct pipe_context *pipe = draw->pipe;
   int i, j;

   if (!draw)
      return;

   /* free any rasterizer CSOs that we may have created.
    */
   for (i = 0; i < 2; i++) {
      for (j = 0; j < 2; j++) {
         if (draw->rasterizer_no_cull[i][j]) {
            pipe->delete_rasterizer_state(pipe, draw->rasterizer_no_cull[i][j]);
         }
      }
   }

   /* Not so fast -- we're just borrowing this at the moment.
    * 
   if (draw->render)
      draw->render->destroy( draw->render );
   */

   draw_pipeline_destroy( draw );
   draw_pt_destroy( draw );
   draw_vs_destroy( draw );
   draw_gs_destroy( draw );

   FREE( draw );
}
Esempio n. 2
0
void draw_destroy( struct draw_context *draw )
{
   struct pipe_context *pipe;
   int i, j;

   if (!draw)
      return;

   pipe = draw->pipe;

   /* free any rasterizer CSOs that we may have created.
    */
   for (i = 0; i < 2; i++) {
      for (j = 0; j < 2; j++) {
         if (draw->rasterizer_no_cull[i][j]) {
            pipe->delete_rasterizer_state(pipe, draw->rasterizer_no_cull[i][j]);
         }
      }
   }

   for (i = 0; i < draw->pt.nr_vertex_buffers; i++) {
      pipe_resource_reference(&draw->pt.vertex_buffer[i].buffer, NULL);
   }

   /* Not so fast -- we're just borrowing this at the moment.
    * 
   if (draw->render)
      draw->render->destroy( draw->render );
   */

   draw_pipeline_destroy( draw );
   draw_pt_destroy( draw );
   draw_vs_destroy( draw );
   draw_gs_destroy( draw );
#ifdef HAVE_LLVM
   if (draw->llvm)
      draw_llvm_destroy( draw->llvm );

   if (draw->own_gallivm)
      gallivm_destroy(draw->own_gallivm);
#endif

   FREE( draw );
}