Exemple #1
0
static void st_destroy_context_priv( struct st_context *st )
{
   uint i;

   st_destroy_atoms( st );
   st_destroy_draw( st );
   st_destroy_generate_mipmap(st);
   st_destroy_blit(st);
   st_destroy_clear(st);
   st_destroy_bitmap(st);
   st_destroy_drawpix(st);
   st_destroy_drawtex(st);

   for (i = 0; i < Elements(st->state.sampler_views); i++) {
      pipe_sampler_view_reference(&st->state.sampler_views[i], NULL);
   }

   for (i = 0; i < Elements(st->state.constants); i++) {
      if (st->state.constants[i]) {
         pipe_resource_reference(&st->state.constants[i], NULL);
      }
   }

   if (st->default_texture) {
      st->ctx->Driver.DeleteTexture(st->ctx, st->default_texture);
      st->default_texture = NULL;
   }

   free( st );
}
Exemple #2
0
static void st_destroy_context_priv( struct st_context *st )
{
   uint shader, i;

   st_destroy_atoms( st );
   st_destroy_draw( st );
   st_destroy_generate_mipmap(st);
   st_destroy_clear(st);
   st_destroy_bitmap(st);
   st_destroy_drawpix(st);
   st_destroy_drawtex(st);

   for (shader = 0; shader < Elements(st->state.sampler_views); shader++) {
      for (i = 0; i < Elements(st->state.sampler_views[0]); i++) {
         pipe_sampler_view_release(st->pipe,
                                   &st->state.sampler_views[shader][i]);
      }
   }

   if (st->default_texture) {
      st->ctx->Driver.DeleteTexture(st->ctx, st->default_texture);
      st->default_texture = NULL;
   }

   u_upload_destroy(st->uploader);
   if (st->indexbuf_uploader) {
      u_upload_destroy(st->indexbuf_uploader);
   }
   if (st->constbuf_uploader) {
      u_upload_destroy(st->constbuf_uploader);
   }
   free( st );
}
Exemple #3
0
static void st_destroy_context_priv( struct st_context *st )
{
   uint i;

#if FEATURE_feedback || FEATURE_drawpix
   draw_destroy(st->draw);
#endif
   st_destroy_atoms( st );
   st_destroy_draw( st );
   st_destroy_generate_mipmap(st);
#if FEATURE_EXT_framebuffer_blit
   st_destroy_blit(st);
#endif
   st_destroy_clear(st);
#if FEATURE_drawpix
   st_destroy_bitmap(st);
   st_destroy_drawpix(st);
#endif
#ifdef FEATURE_OES_draw_texture
   st_destroy_drawtex(st);
#endif

   _vbo_DestroyContext(st->ctx);

   for (i = 0; i < Elements(st->state.sampler_texture); i++) {
      pipe_texture_reference(&st->state.sampler_texture[i], NULL);
   }

   for (i = 0; i < Elements(st->state.constants); i++) {
      if (st->state.constants[i].buffer) {
         pipe_buffer_reference(st->pipe->screen, &st->state.constants[i].buffer, NULL);
      }
   }

   if (st->default_texture) {
      st->ctx->Driver.DeleteTexture(st->ctx, st->default_texture);
      st->default_texture = NULL;
   }

   free( st );
}